| Author |
String Objects count
|
Nimit Shah
Ranch Hand
Joined: Jul 02, 2007
Posts: 52
|
|
See the following code. 11. public String makinStrings() { 12. String s = "Fred"; 13. s = s + "47"; 14. s = s.substring(2, 5); 15. s = s.toUpperCase(); 16. return s.toString(); 17. } How many String objects will be created when this method is invoked? A. 1 B. 2 C. 3 D. 4 E. 5 F. 6 Answer: C I thought that the answer would be E i.e. 5 String objects created. Can anybody please explain me how comw the answer is C?
|
 |
Manfred Klug
Ranch Hand
Joined: Jun 04, 2007
Posts: 377
|
|
Hi Nimit, hava a look here. [ July 09, 2007: Message edited by: Manfred Klug ]
|
 |
 |
|
|
subject: String Objects count
|
|
|