String s1,s2,s3,s4
s1=new String("hello");
s2=new String("hello");
s1.equals(s2);//ok
s3=s1.intern();
s4=s2.intern();
if(s3==s4)//ok
But if i do:-
if(s1==s3)//not ok(not refer to same object);
if(s2==s4)//not ok
when String method intern is invoke on the
String object,it return a reference to a String object that
is guaranteed to have the same contant,However,String
s1 and String s2 have the same contents,the reference
returned by this call to intern is a reference to the
String object returned by s1.intern() and s2.intern().But s1==s3 and
s2==s4 give that they are not refer to same object,Why?;