Computers and Technology

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)

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:30, amaliabarrera9
The can be used to paste text in any order
Answers: 1
image
Computers and Technology, 22.06.2019 11:10, lberman2005p77lfi
The total cost of textbooks for the term was collected from 36 students. create a histogram for this data. $140 $160 $160 $165 $180 $220 $235 $240 $250 $260 $280 $285 $285 $285 $290 $300 $300 $305 $310 $310 $315 $315 $320 $320 $330 $340 $345 $350 $355 $360 $360 $380 $395 $420 $460 $460
Answers: 2
image
Computers and Technology, 22.06.2019 15:00, yeet74
I'm taking a class on how to make a movie, and it offers some apps that would be in the process. the thing is, i don't have any of those ha. if you have any tips on some apps i could use, that would be awesome. i don't have an iphone, so don't suggest any apps like imovie. i know that this is a weird question, but it would be super for me. : )
Answers: 2
image
Computers and Technology, 22.06.2019 15:30, 1232444553
Which of the following examples has four beats in each measure?
Answers: 2
Do you know the correct answer?
HELP PLEASE:
Consider the following method that is intended to test if all the Strings in the...

Questions in other subjects:

Konu
History, 20.08.2020 17:01
Konu
English, 20.08.2020 17:01