Consider the Java segment:
String line1 = new String("c = 1 + 2 + 3") ;
StringTokenizer tok = new StringTokenizer(line1, "+=") ;
String foo = tok.nextToken() ;
String bar = tok.nextToken() ;
The values of foo and bar are:
A) foo is "c ", bar is " = ".
B) foo is "c", bar is " ".
C) foo is " = ", bar is " + ".
D) foo is "c ", bar is " 1 ".
Correct Answer:
Verified
Q16: The statement
s1.startsWith("art")
Has the same result as
Q17: Which of the following statements is true?
A)
Q18: String objects are immutable. This means they
Q19: Given the following declarations:
StringBuilder buffer =
Q20: Which of the following creates the string
Q21: Which of the following statements is true?
A)
Q22: Consider the Java segment:
String line1 =
Q24: Which class is not a type-wrapper class?
A)
Q25: Which of the following are static Character
Q26: Consider the Java segment:
String line1 =
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents