| Author |
String object declaration problem
|
MohamedSalim malik
Greenhorn
Joined: Feb 04, 2011
Posts: 19
|
|
In my SCJP class they taught us like Strings are considered as Objects in java.. If so the above s1,s2 should be two references which points to TWO OBJECTS . Am i correct.?
But when i compile and run this i got a result showing true. I am confused
then i made another program..
When i run this, it showed the boolean value as 'false'. It indicates that this is two different objects.(is that correct?) My question is that, which is considered as
a OBJECT in java From above two declarations.?? can someone explain me?
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14669
|
|
|
We have a Journal article about Strings and the String pool. Check it here.
|
[My Blog]
All roads lead to JavaRanch
|
 |
MohamedSalim malik
Greenhorn
Joined: Feb 04, 2011
Posts: 19
|
|
Awesome artical.. now i got it.. thanks for your help.. :
|
 |
 |
|
|
subject: String object declaration problem
|
|
|