Hi there,
I think the answer given i.e 2 Strings are in the VM string-pool is correct.
Let's analyse
String s1 = "javacoding.net";
creates a new String object and places the String literal "javacoding.net" in the pool
String s2 = "javacoding.net";
refers to the same String literal created above. So no new String is created.
String s3 = new String("javacoding.net");
creates 2 objects(because we used the new keyword,
Java will create a new String object in the normal (nonpool) memory and s3 will refer to it and the String literal "javacoding.net" is placed in the pool.
So at the end , 2 String literal's are created.
Hope it helps, Good luck,