subject

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.(0) ! = s. charat(0)) {
return true;
}
}
return false;

ii.

for (string s: a) {
if (s.(0) ! = s. charat(0)) {
return false;
}
}
return true;

iii.

int flag = 1;
for (string s: a) {
if (s.(0) ! = s. charat(0)) {
flag = 0;
}
}
return (flag == 1);
ii only
iii only
i, ii and iii
i only
ii and iii

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:30, jennyrr9021
This isn’t really school related, but like where the heck can you find manga, to read to where you don’t have to pay money, for points? my friend wants me to read bj alex, and i can’t find it anywhere for free.
Answers: 2
image
Computers and Technology, 23.06.2019 02:00, HannahVance99
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
image
Computers and Technology, 23.06.2019 16:00, ginaaa20
Which analyst position analyzes information using mathematical models to business managers make decisions?
Answers: 1
image
Computers and Technology, 23.06.2019 17:30, Artemis3821
Scientists have changed the model of the atom as they have gathered new evidence. one of the atomic models is shown below. what experimental evidence led to the development of this atomic model from the one before it? a few of the positive particles aimed at a gold foil seemed to bounce back. the colors of light emitted from heated atoms had very specific energies. experiments with water vapor showed that elements combine in specific proportions. cathode rays were bent in the same way whenever a magnet was brought near them.
Answers: 2
You know the right answer?
Consider the following method that is intended to test if all the strings in the arraylist start wit...

Questions in other subjects:

Konu
Computers and Technology, 16.12.2020 06:10
Konu
Mathematics, 16.12.2020 06:10