Java / Using String
How many String objects be created by the snippet and where it is stored in Java?
String str1 = "javapedia.net"; String str2 = "javapedia.net";
Only one string object will be created and this object be stored in the string (constant) pool.
More Related questions...