A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
EJB 3 in Action
this week in the
EJB and other Java EE Technologies
Java in General
Creating new Strings
Joined: Feb 12, 2010
Mar 04, 2010 21:14:30
s ="abc" // Creates one String object and one reference variable. How ?
String s = new String("abc") // Creates two objects, and one reference variable. How ?
Can someone please explain the above two comments.
Joined: May 21, 2006
Mar 04, 2010 21:26:43
This question has been asked many times. Please
A couple of threads discussing the same
Joined: Dec 17, 2009
Mar 28, 2010 11:00:48
Also this thread could be useful
I agree. Here's the link:
subject: Creating new Strings
when will == return true for Strings
String literal objects in String pool
Difference between String
a question on creating string object.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014