Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Variable Name as Object Name

807606Feb 24 2007 — edited Mar 14 2007
How do I define a name for a new instance of a class using a variable content as the name?

so in the example below i want test to be the name of the instance created of the new class object, but for some reason it doesn't get the content of the string instead takes the string name.
String name = "test";
room name = new room();
Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 11 2007
Added on Feb 24 2007
16 comments
223 views