Below code represents the same operation but results getting differes ? can any one tell me how the java executs the == operation ?
String str = new String("Hello");
String str1 = new String("Hello");
System.out.println(str == str1);
o/p False
String str = "Hello";
String str1 = "Hello";
System.out.println(str == str1);
o/p True