ANSWERS
When using the StringBuilder class's insert method, you can insert
Select one:
a. any primitive type
b. a String object
c. a char array
d. all of the above - CORRECT ANSWERS d. all of the above
Using the StringBuilder class's insert method, you can insert
Select one:
a. A String object
b. A char array
c. A primitive type
d. All of the above - CORRECT ANSWERS d. All of the above
What will be the value of loc after the following code is executed?
int loc;
String str = "The cow jumped over the moon.";
loc = str.lastIndexOf("ov", 14);
,Select one:
a. 15
b. 16
c. -1
d. 0 - CORRECT ANSWERS c.
Which of the following are categories of JOptionPane?
Select one:
a. constant dialog
b. message dialog
c. input dialog
d. both message an input dilog - CORRECT ANSWERS d. both message an input dilog
String objects are immutable.
Select one:
True
False - CORRECT ANSWERS true
What will be the value of matches after the following code has been executed?
boolean matches;
String str1 = "The cow jumped over the moon.";
, String str2 = "moon";
matches = str1.endsWith(str2);
Select one:
a. moon
b. True
c. False
d. The cow - CORRECT ANSWERS false
The no-arg constructor for a StringBuilder object gives the object enough storage space to hold
this many characters.
Select one:
a. 16 characters
b. 8 characters
c. 32 characters
d. 0 characters - CORRECT ANSWERS a. 16 characters
Assuming that str is declared as follows,
String str = "RSTUVWXYZ";
what value will be returned from str.charAt(5)?