I tried the following code in netbeans and I received the output value as false
I want to know how the equal() works actually.
My code was:
StringBuffer x=new StringBuffer("Hey");
StringBuffer y=new StringBuffer("Hey");
System.out.println(x.equals(y));    // my output was false
 
     
     
     
     
     
    