This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes String Objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String Objects" Watch "String Objects" New topic
Author

String Objects

Shreya Raina
Greenhorn

Joined: Sep 17, 2011
Posts: 1
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

Joined: Oct 13, 2005
Posts: 38075
    
  22
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String Objects
 
Similar Threads
How many objects are created ?
how many objects will create
Immutability of strings???
How many Objects are garbage collected?
String objects