Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Java in General and the fly likes String literal pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "String literal pool" Watch "String literal pool" New topic

String literal pool

anish jain
Ranch Hand

Joined: Feb 03, 2010
Posts: 129
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

Joined: Jul 30, 2010
Posts: 93
Following link contains explanation:
I agree. Here's the link:
subject: String literal pool