Why two string objects which are declared using String class constructor with identical string literal are not equal when compared using equality operator '==', but when declared directly by assigning identical string literals are equal.
String s1 = new String("hello");
String s2 = new String("hello");
Boolean result1 = (s1 == s2);// returns false
String s3 = "hello";
String s4 = "hello";
Boolean result2 = (s3 == s4);// returns true