P
priyom
Hi,
I found the following behaviour in StringBuffer and StringBuilder
equals method.
StringBuffer sb1 = new StringBuffer("ABC");
StringBuffer sb2 = new StringBuffer("ABC");//It can be any string same
as above
System.out.println(sb1.equals(sb2)); //this prints false!
Could someone please explain this behaviour.
Thanks in advance,
Priyom
I found the following behaviour in StringBuffer and StringBuilder
equals method.
StringBuffer sb1 = new StringBuffer("ABC");
StringBuffer sb2 = new StringBuffer("ABC");//It can be any string same
as above
System.out.println(sb1.equals(sb2)); //this prints false!
Could someone please explain this behaviour.
Thanks in advance,
Priyom