File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
It's not a secret anymore!