Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Tim Cooke
Liutauras Vilda
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Rob Spoor
Junilu Lacar
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Piet Souris
Carey Brown
Bartenders:
Forum:
Programmer Certification (OCPJP)
Questions about Strings
Joerg Waldmann
Greenhorn
Posts: 17
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
When using this :
String
s = new String("abc");
Is then "abc" in the String Pool, or just the String Object on the heap?
And another Question:
Is the memory in the String Pool freed by the Garbage Collector, too?
Gr��e
J�rg
mambe nanje
Ranch Hand
Posts: 31
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
abc is kept in the string pool and at thesame time it is kept in the heap as the string object, anyways I could be wrong, and as of the gabage collection no idea but I guess if no reference to the string in pool it is to be gabbage collected
Da Clone in programming world
Rajendra
Ranch Hand
Posts: 48
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Garbage Collector doesn't collect the strings which are in String pool.They will be in pool only when there is no reference also.
correct me if I'm wrong.
Thanks,
Rajendra.
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Question on Strings and String pool
Where the object is created?
case of two equal object
"abc"=="abc"?
Stack Variables and GC
More...