How many String objects are instantiated by the following code segment (not including the literals) ?
String s1,output;
S1 = "hello";
Output = "\nThe string reversed is: " ;
For (int i = s1.length() - 1;i >= 0;i--)
Output += s1.charAt(i) + " " ;
A) 1.
B) 4.
C) 5.
D) 7.
Correct Answer:
Verified
Q11: Given the following declarations:
StringBuilder buf;
StringBuilder buf2
Q13: To find the character at a certain
Q15: An anonymous String _.
A)has no value
B)is a
Q17: Which of the following statements is true?
A)
Q17: The length of a string can be
Q18: The statement
S1)startsWith("art")
Has the same result as which
Q19: Given the following declarations:
StringBuilder buffer =
Q19: Consider the String below:
String r = "a
Q20: The String method substring returns _.
A)a char
B)a
Q21: Which of the following statements is true?
A)
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