I saw the following question in a mock exam site...
public class Test1 {
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));
System.out.println("Poddar".substring(3));
}
}
The result when I run this is false,false,false,dar..
But,what I expected was false,true,false,dar..
can someone clarify...