Skip to Main Content

Question regarding String objects and memory

807591May 2 2008 — edited May 4 2008
I have following two statements:

String str1 = new String("java");
String str2 = "java";

Now how many objects are created by each line and where?
Secondly, where is strings constant pool created? IN the heap itself??
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Jun 1 2008
Added on May 2 2008
16 comments
212 views