1

Suppose I have a string literal like,

String s1 = "ABC";

And another String object like,

String s2 = new String("ABC");

So is there any connection or relation between String s1 and s2 from java's memory point of view, as s1 is in the string constant pool and s2 is in the heap memory.

Idan Str
  • 614
  • 1
  • 11
  • 33
shaggy007
  • 69
  • 8

0 Answers0