![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 01.02.2021 20:40 ayoismeisjjjjuan
Consider the following incomplete method, which is intended to return the longest string in the string array words. Assume that the array contains at least one element.
public static String longestWord(String[] words)
{
/* missing declaration and initialization */
for (int k = 1; k < words. length; k++)
{
if (words[k].length() > longest. length())
{
longest = words[k];
}
}
return longest;
}
Which of the following can replace /* missing declaration and initialization */ so that the method will work as intended?
a. int longest = 0;
b. int longest = words[0].length();
c. String longest = "";
d. String longest = words[0];
e. String longest = words[1];
![ansver](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 20:30
What are some settings you can control when formatting columns?
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 07:30
John recently worked on a project about various programming languages. he learned that though procedural language programs are useful, they have disadvantages too. what is a disadvantage of programs written in procedural languages? a. programs do not represent data complexity. b. programs take more time to execute. c. programs are prone to security threats. d. programs do not interface with multiple platforms.
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 17:30
Looking at the electroscope, describe how you can cause the two leaves at the bottom to repel each other and stay that way
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 19:00
Luis is cloud-based( microsoft bot framework). true false
Answers: 1
You know the right answer?
Consider the following incomplete method, which is intended to return the longest string in the stri...
Questions
![question](/tpl/images/cats/geografiya.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/istoriya.png)
History, 30.11.2020 22:10
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 30.11.2020 22:10
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/en.png)
English, 30.11.2020 22:10
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/es.png)
Spanish, 30.11.2020 22:10
![question](/tpl/images/cats/en.png)
English, 30.11.2020 22:10
![question](/tpl/images/cats/mat.png)
Mathematics, 30.11.2020 22:10
![question](/tpl/images/cats/istoriya.png)
History, 30.11.2020 22:10
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/geografiya.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/en.png)