Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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
Pie
Posts: 49789
69
  • 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