Examlex

Solved

How Many String Objects Are Instantiated by the Following Code

question 21

Multiple Choice

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) + " " ;


Definitions:

Related Questions