public class StringBuffercheck
{
public static void main(
String args[])
{
StringBuffer s1= new StringBuffer("LALIT");
StringBuffer s2= new StringBuffer("LALIT");
if(s1.equals(s2))
System.out.println("Equal");
else
System.out.println("Not equal");
}
}
Why is it giving the result as "Not equal"?
How can we check for the equality of two string buffers?
I am confused?
Please help....
Thanks in advance
Lalit