How does a StringBuffer handle strings internally? I tried running the below example and got the answer as "String are unequal".
From what I know is that the equals() returns true if both the strings have the same value. So what is happening in this case?
class StringBufferTest {
public static void main(String[] args) {
    String newString = "HelloWorld";
    StringBuffer buffer = new StringBuffer(newString);
    if (buffer.equals(newString)) {
        System.out.println("Strings are equal");
    } else {
        System.out.println("String are unequal");
    }
  }
}
 
     
     
     
     
     
    