String s1 = "hello world";
String s2 = "hello world";
// output of first is Yes
the reason being that in above code you are comparing two references
public static void point1()
String s = new String("Friday");
String s1 = new String("Friday");
if (s == s1)
ANS : Equal B
Because they are two different objects on heap , refering diff memeory addresses
hence their reference is not same.
more explanation here.