subject

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)

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 02:00, hctlawton
Which software would you use to create a print design? a. illustrator b. audacity c. reaper d. dreamweaver
Answers: 2
image
Computers and Technology, 24.06.2019 05:50, 11232003
What all vehicles has tesla inc. created over the years
Answers: 3
image
Computers and Technology, 24.06.2019 12:00, elainnysanchez1541
How can we take picture in this app
Answers: 1
image
Computers and Technology, 24.06.2019 15:20, 710jonathan
Local area networks use many of the same network technologies and the internet, only on a smaller scale. devices that access lans are equipped with a network interface that contains circuitry for wireless or wired connections. devices also have a physical address, in addition to the ip addresses acquired from a dhcp server. the most popular wired technology is . the most popular wireless technology is , which can be configured as a(n) or star topology. setting up a lan and configuring its router is fairly easy. the first step is to change the standard to one that is secure. next, create a(n) that uniquely identifies the network by name. it is also important to activate wireless to prevent wireless signals from being intercepted during transmission. a limited-access network can be created for visitors to use. by activating , the router will be able to assign ip addresses to each device that joins the network. to connect to a secure lan that is protected by encryption, an encryption , or password, is required. lans can be used to access data collected by iot devices and the networks that tie these devices together. technologies such as rfid, nfc, bluetooth smart, zigbee, and z-wave offer -power links, essential for battery-powered devices that can’t expend excess amounts of energy transmitting data.
Answers: 1
You know the right answer?
HELP PLEASE:
Consider the following method that is intended to test if all the Strings in the...

Questions in other subjects:

Konu
Mathematics, 19.10.2021 14:00