- When a Class was compiled the String literals are noted in a special way by the compiler.
- Once the Class get loaded, all the String literals which are inside the class are placed inside the String Constant Pool. So once the Class got initialized all the String literals are ready for use.
- String Constant Pool is Constant Table which will hold all the String Literal Objects which lives on the heap.
- Most of people think String Constant Pool is where the String Literal Object are Stored, but that's not true."All the Objects are Stored one and only in HEAP"
- During Garbage Collections, the values which are String Literals are not Garbage Collected. The reason is GC only collects the objects which are not referred. But String Literals objects (in Heap) are referred by the String Constant Pool (Constant Table).
Thursday, October 22, 2009
5 Things you should know about String Constant Pool.
Subscribe to:
Post Comments (Atom)
1 comment:
are you sure buddy? i guess not.
Post a Comment