Can any one explain Question 87 and 89 from this link http://www.javatpoint.com/corejava-interview-questions-3
87) How many objects will be created in the following code?
String s1 = "string1";
String s2 = "string1";
String s3 = "string1";
Answer is : only one object
89)How many objects will be created in the following code?
String s = new String("Welcome");
Answer is : Two objects, one in string constant pool and other in non-pool(heap).