A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
String s = new String("abc"); //two objects??
Max White
Ranch Hand
Joined: Jun 28, 2008
Posts: 83
posted
Jul 03, 2008 14:57:00
0
K&B says that the above statement creates two objects and one reference variable.I can see clearly see one reference and one object.Where is the second object?
Thanks..
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32599
4
posted
Jul 03, 2008 15:59:00
0
I think you have got the answer on your other thread, so I shall close this one.
Please
avoid asking the same question twice.
I agree. Here's the link:
http://aspose.com/file-tools
subject: String s = new String("abc"); //two objects??
Similar Threads
How many string objects created??
Strange Byte Comparision
String Object Creation
String literal objects in String pool
String difference
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter