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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:30
Melissa needs to add a topic to an email that she will send to her teacher. choose the name of the field where she should type her topic.
Answers: 2
question
Computers and Technology, 22.06.2019 19:30
Singing in the rain: this first part of the film shows the early history of motion picture. how accurate do you think the portrayal of the early motion picture industry is? why? is historical accuracy important in films and theater productions? explain.
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Knowing that the central portion of link bd has a uniform cross sectional area of 800 mm2 , determine the magnitude of the load p for which the normal stress in link bd is 50 mpa. (hint: link bd is a two-force member.) ans: p = 62.7 kn
Answers: 2
question
Computers and Technology, 23.06.2019 15:20
An ou structure in your domain has one ou per department, and all the computer and user accounts are in their respective ous. you have configured several gpos defining computer and user policies and linked the gpos to the domain. a group of managers in the marketing department need different policies that differ from those of the rest of the marketing department users and computers, but you don't want to change the top-level ou structure. which of the following gpo processing features are you most likely to use? a, block inheritance b, gpo enforcement c, wmi filtering d, loopback processing
Answers: 3
You know the right answer?
Consider the following method that is intended to test if all the strings in the arraylist start wit...
Questions