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 11:00
How does a policy manual an organization? a. it boost productivity. b. it create awareness in employees about the organization’s values. c. it employees achieve targets. d. it safeguards the organization from liabilities.
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
The salespeople at hyperactive media sales all use laptop computers so they can take data with them on the road. you are a salesperson for superduper lightspeed computers talking to hyperactive media sales about upgrading the laptops to windows 10. explain how network location awareness in windows 10 would make the laptops more secure.
Answers: 3
question
Computers and Technology, 23.06.2019 10:30
How would you categorize the software that runs on mobile devices? break down these apps into at least three basic categories and give an example of each.
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
The initial tableau of a linear programming problem is given. use the simplex method to solve it. x 1 x 2 x 3 s 1 s 2 z 1 2 4 1 0 0 8 3 4 1 0 1 0 10 minus3 minus12 1 0 0 1 0 the maximum is nothing when x 1equals nothing, x 2equals nothing, x 3equals nothing, s 1equals3, and s 2equals0. (be sure to simplify to lowest terms if necessary.)
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
question
Mathematics, 28.10.2020 07:30
question
Mathematics, 28.10.2020 07:40
question
Social Studies, 28.10.2020 07:40
question
Mathematics, 28.10.2020 07:40
Questions on the website: 13722360