please check this code
class Test45
{
public static void main(
String[] args)
{
String s1 = new String("ABC"), s2 = new String("ABC");
StringBuffer sb1 = new StringBuffer("ramesh");
StringBuffer sb2 = new StringBuffer("malli");
System.out.print(s1.equals(s2) + "," + sb1.equals(sb2) +","+ (sb1==sb2));
}
What's the answer for this . I think true,false,false.
My doubt is can't we ever compare StringBuffers How can we say two String Bufferes are equal,explain .