108. 1. Given:
What is the result?
A. x1,y23,z4,
B. x,y,z,
D. x,y,,z,,
E. Compilation fails.
C. x,y,,z,
109. 2. Given :
What is the result?
A. x1,y23,z4,
D. x,y,,z,,
B. x,y,z,
C. x,y,,z,
E. Compilation fails..
110. 3. Given :
Which codes, inserted at line 4, will print "love!"? (Choose
all that apply.)
A. b.delete(0, 2).replace(1,3,"o").append("!");
B. b.substring(2,6).insert(1, "o").replace(2,6,"ve!");
C. b.delete(6,7).delete(0,2).insert(1, "o").replace(2,6,"ve!");
D. b.insert(3, "o").replace(0,2,"").delete(2,4).replace(3,4,"e!");
E. b = "ove".insert(0,1,"l").append("!");
111.
112. 4. What 's the result of following program:
A. unm
B. udm
D. Compilation fails.
E. Runtime error.
C. ude
113. 5. Given:
Which statements are true? (Choose a l l that apply. )
A. This code will have better performance if rewrited to: return
"<"+s.subString(0, n)+">";
B. This code will have better performance if replace StringBuffer
to StringBuilder.
C. If replace StringBuffer to StringBuilder, no other change
should be made.
D. This code is not thread-safe.
E. This code will be thread-unsafe if replace StringBuffer to
StringBuilder.
114.
115. 6. Which statements concerning String, StringBuffer, and
StringBuilder are true? (Choose all that apply.)
A. All three classes have a substring() method.
B. All three classes have a length() method.
C. All three classes have overload append() method.
D. Only String class can use + operator.
E. Only StringBuffer class is thread-safe.
F. StringBuilder has better performance than StringBuffer.
G. The value of an object of those classes can be modified by
their methods