public class checkBuffer
{
public static void main(
String args[])
{
StringBuffer sb1 = new StringBuffer("String");
StringBuffer sb2 = new StringBuffer("String");
if(sb1.equals(sb2))
{
System.out.println("yes");
}
}
}
The equals() method giving false in if statement.
why the equals() method is not working with StringBuffer?