Suppose ArrayList x contains two strings [Beijing, Singapore]. Which of the following method will cause runtime errors?

a. x.get(1)
b. x.set(2, "New York");
c. x.get(2)
d. x.remove(2)
e. x.size()


b. x.set(2, "New York");
c. x.get(2)
d. x.remove(2)
There is no element at index 2.

Computer Science & Information Technology

You might also like to view...

USB stands for _____.

A. Universal System Bus B. Used Serial Bus C. Universal Serial Bus D. Universal Standard Bus

Computer Science & Information Technology

Case WD 6-2Cole is working on putting together a flyer for a local art show that he is coordinating.Cole places clip art of a door on the cover of the flyer, with the word "Welcome."  He notices that the door is a little too big, and wants to change its size proportionately. Cole would ____.

A. drag a corner sizing handle B. drag a side sizing handle C. either a. or b. D. neither a. nor b.

Computer Science & Information Technology

What technology is used to assure that the logical block addressing on a solid state drive does not always address the same physical blocks, in order to distribute write operations?

A. wear leveling B. bit shifting C. block sliding D. data migration

Computer Science & Information Technology

The numbers in our worksheet look like this: 1000. You want them to look like this: $1,000.00. How can you accomplish this?

A. None of these B. Select Format > Money from the menu C. You have to retype everything and manually add the dollar signs, commas, and decimals. D. Click the Currency Style button on the formatting toolbar

Computer Science & Information Technology