A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
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
a question on creating string object.
when will == return true for Strings
Difference between String
String literal objects in String pool
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014