subject

HELP PLEASE:
Consider the following method that is intended to test if all the Strings in the ArrayList start with an uppercase letter:

public static boolean capitalized(ArrayList a) {
/* Missing Code */
}

Which of the following could replace /* Missing Code */ so that the method works as intended?

I.

for (String s: a) {
if (s. toUpperCase().charAt(0) != s. charAt(0)) {
return true;
}
}
return false;

II.

for (String s: a) {
if (s. toUpperCase().charAt(0) != s. charAt(0)) {
return false;
}
}
return true;

III.

int flag = 1;
for (String s: a) {
if (s. toUpperCase().charAt(0) != s. charAt(0)) {
flag = 0;
}
}
return (flag == 1);

...possible answers are (I only), (II only), ( II and III), (I, II, and III), or (III only)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
How is the number 372 written when expanded out to place values in the base 8 (octal) number system? a. 2 x 4 + 3 x 2 + 4 x 1 b. 3 x 64 + 7 x 8 + 2 x 1 c. 3 x 8 + 7 x 7 + 2 x 6 d. 3 x 100 + 7 x 10 + 2 x 1
Answers: 1
question
Computers and Technology, 22.06.2019 22:00
What is a distinguishing feature of today’s graphic application software?) graphic applications are used today on a variety of devices, including touch-screen kiosks and mobile phones.
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
What is html ? give a small description about html
Answers: 2
question
Computers and Technology, 23.06.2019 20:00
What multimedia system creates an immersive, real-life experience that the user can interact with?
Answers: 1
You know the right answer?
HELP PLEASE:
Consider the following method that is intended to test if all the Strings in the...
Questions
question
Mathematics, 11.07.2019 17:00
question
World Languages, 11.07.2019 17:00
Questions on the website: 13722361