I have the following lines from the Java code
{
String str1=new String("Vivek");
String str2=new String("Vivek");
StringBuffer str3=new StringBuffer("Vivek");
StringBuffer str4=new StringBuffer("Vivek");
System.out.println(str1.equals(str2));
System.out.println(str3.equals(str4));
}
Now i get the output as following
True
False
I cant get why it prints true for String oject and false for objects of StringBuffer? Has it to do something with mutability of objects?