• Post Reply Bookmark Topic Watch Topic
  • New Topic

String literal pool  RSS feed

 
anish jain
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we say String s="hello", then "hello" object will be created in heap.

I want to know if this object is created in heap with reference stored in the string literal pool. Is this right? or String literal pool is separate memory area outside heap?
 
john sal
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following link contains explanation:

http://www.coderanch.com/t/381045/java/java/String-Memory-Allocation
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!