This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
    Bookmark Topic Watch Topic
  • New Topic

String s = new String("abc"); //two objects??

 
Max White
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 48921
58
  • Mark post as helpful
  • send pies
  • Report post to moderator
I think you have got the answer on your other thread, so I shall close this one.
Please avoid asking the same question twice.
 
    Bookmark Topic Watch Topic
  • New Topic