Computers and Technology

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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:30, mesposito
Technician a says that a dry sump system uses no oil storage sump under the engine. technician b says that a wet sump system uses no oil storage sump under the engine. who is correct?
Answers: 3
image
Computers and Technology, 22.06.2019 22:10, Metlife
Asequential circuit contains a register of four flip-flops. initially a binary number n (0000 ≤ n ≤ 1100) is stored in the flip-flops. after a single clock pulse is applied to the circuit, the register should contain n + 0011. in other words, the function of the sequential circuit is to add 3 to the contents of a 4-bit register. design and implement this circuit using j-k flip-flops.
Answers: 1
image
Computers and Technology, 23.06.2019 04:31, mjweed3381
Cloud computing service providers manage different computing resources based on the services they offer. which resources do iaas and paas providers not manage? iaas providers do not manage the for the client, whereas paas providers usually do not manage the for their clients. iaas- storage server operating system network paas- applications interafce storage vertualiation
Answers: 2
image
Computers and Technology, 24.06.2019 02:30, journeyhile5
How to apply the fly in effect to objects on a slide
Answers: 1
Do you know the correct answer?
Consider the following method that is intended to test if all the strings in the arraylist start wit...

Questions in other subjects:

Konu
Mathematics, 26.09.2019 03:21