Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String Objects

 
Shreya Raina
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello Everyone!!

Please answer this for mee..
If
String s1="abc"
and
String s2=s1+ "def"

How many objects are created and how??

Thanks!!
 
Campbell Ritchie
Sheriff
Pie
Posts: 50196
79
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.
You need three objects: a pencil, an eraser (probably the most important ) and a sheet of paper. You write down a short description of each object, whether it is created at runtime or when the class is loaded, and then you count them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic