A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
Other Open Source APIs
Programmer Certification (SCJP/OCPJP)
Creating String Objects
Joined: Feb 04, 2005
Feb 05, 2005 01:48:00
this was a question i stumbled upon
The answer says that 4 String objects are created can someone give me an explanation as to how 2 string objects are being created in the first line...
Joined: Sep 24, 2003
Feb 05, 2005 02:51:00
A String instance is created that represents the String literal, which is passed to the String(String) constructor to create yet another String instance.
Java Q&A (FAQ, Trivia)
I agree. Here's the link:
subject: Creating String Objects
How many object created ?
Query in Strings -Pass by Reference
Hom many Objects are created ???
number of objects created?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015