This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes How many objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How many objects" Watch "How many objects" New topic

How many objects

gita bal

Joined: Feb 22, 2010
Posts: 4
String a="hello"
String b="world"
String c=a+b

How many objects will be created and why?

Can somone answer this?
nitinram agarwal
Ranch Hand

Joined: Jan 29, 2009
Posts: 83
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38436
nitinram agarwal, please do not give a direct answer to such a question. See what it says on the title page of this forum:
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
Since gita bal would learn far better from working out the answer, I have pulled rank and deleted your answer.

gita bal, welcome to the Ranch and how many objects do you think are created?
jQuery in Action, 2nd edition
subject: How many objects