Home » Java » String constant pool in Java [on hold]

String constant pool in Java [on hold]

Posted by: admin June 30, 2018 Leave a comment

Questions:

Question No 1:
– Why string constant pool supports only string data type to store in Java?
– Why not other data type or wrapper class?

Question 2 :

How many objects will be created for the below code? and why?

String str1 ="abc";

String str2 = new String("abc");
Answers: