0
is there any thing called static pool in jvm
I think the static variables will be stored here
1 ответ
+ 3
If you Create any String objects then it always Stored in STRING POOL CONSTANT.. String Pool constant is Inside Heap AREA....If u r Using String Literal to Create String then It It will store in SPC
and if already exists the refer to same Memory
ex. String s1="Hello";
String s2="Hello";
in this case S1 and S2 will focus to same Memory..
If u r Using NEW keyword to create String object then it will directly save to HEAP MEMORY
EX
String s1=new String "Hello";
String s2=new String "Hello";
S1 and s2 will stores Individual memory for Hello in heap Area Directly..