Check out the following:
public class
test {
public static void main(
String args[])
{
StringBuffer sb1 = new StringBuffer("Hello");
StringBuffer sb2 = new StringBuffer("Hello");
boolean result = sb1.equals(sb2);
System.out.println(result);
}
}
Why does it print false???
If you change StringBuffer to String and run it, it will print
true. Please explain this burning question. Thanks. Am I
missing some simple concept?