
package org.day.strings;
import java.io.BufferedReader;
public class Test { public static void main(String[] args) { StringBuffer sb1 = new StringBuffer(); sb1.append("Daya");
StringBuilder sbu2 = new StringBuilder();
sbu2.append("Daya");
System.out.println(sb1.equals(sbu2));
/* why sb1 and sbu2 are not equal */
}
}

it is coz whenever objects are created with new operator, a new memory is allocated and hence new reference id generated;
so sb1 and sbu2 will get different refence ids;
here equals method of Object class will work it compares two refernce id which are not equal.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.