I want to clarify a doubt here
when we create a string via new operator
String s=new String("jk");
jk goes in String constant pool and heap
Now see
String s1=s+"winter";
//case1
or
String s1="jk"+new String("winter");
Does winter in both case go to String Const pool?
How do i check it?
Aucun commentaire:
Enregistrer un commentaire