A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
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.
It is sorta covered in the
JavaRanch Style Guide
subject: Another String object confusion
How many String objects have been created?
Is Kathy&Bert book wrong? Or my understanding wrong?
String is created on pool?
Yet another string pool doubt
need help for a question
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014