| Author |
String objects
|
rengarajan vaikuntam
Ranch Hand
Joined: Oct 04, 2004
Posts: 37
|
|
Look at this snippet: String st = new String("JAVA"); How many objects are created and how many reference variables are created?
|
 |
Corey McGlone
Ranch Hand
Joined: Dec 20, 2001
Posts: 3271
|
|
|
2 Strings. 1 Reference variable.
|
SCJP Tipline, etc.
|
 |
rengarajan vaikuntam
Ranch Hand
Joined: Oct 04, 2004
Posts: 37
|
|
Thanks corey so if i have class called MyClass and if i say MyClass mc = new MyClass(); Here also can i say 2 objects are created one with the keyword new and the other null and one reference variable mc. thanx.
|
 |
 |
|
|
subject: String objects
|
|
|