A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
EJB 3 in Action
this week in the
EJB and other Java EE Technologies
Programmer Certification (SCJP/OCPJP)
Another String object confusion
Joined: Sep 22, 2004
Nov 04, 2004 11:57:00
a = "test";
a = null;
String b = "test";
Line 1 creates a new string instance and then places it in the String pool. Is that correct?
Also does Line 3 recreate a new object or does it use the object that was placed in the String pool. I'm confused about the relation between the String pool and the heap.
[ November 04, 2004: Message edited by: Francis Palattao ]
SCJP 1.4 <br />SCWCD 1.4 (preparing)<br />SCBCD 1.3 (coming soon)
Joined: Dec 20, 2001
Nov 04, 2004 12:07:00
SCJP Tipline, etc.
I agree. Here's the link:
subject: Another String object confusion
need help for a question
Yet another string pool doubt
String is created on pool?
How many String objects have been created?
Is Kathy&Bert book wrong? Or my understanding wrong?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014