For the following code:
public class abc
{
public static void main(
String args[])
{
StringBuffer sb1 = new StringBuffer("Amit");
StringBuffer sb2 = new StringBuffer("Amit");
String ss1 = "Amit";
System.out.println(sb1==sb2);
System.out.println(sb1.equals(sb2));
System.out.println(sb1.equals(ss1));
}
}
The answer is false false false and I verified it. Why is it not true true and false? Please explain...
Thanks and Regards
Vineet