dcsimg
Object Creation
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ajit_roy
Posted On:   Wednesday, April 27, 2005 03:44 AM

Hi,

I have a method which takes a string argument.Now in the method I want to create an object having unique name,every time the method is invoked.Like when the method is called and I have passed "abc" as argument then my object name should be abc.
MyObject abc=new MyObject();.But it is not possible.Can anybody suggest some way of doing it.



with regards,
Ajit

Re: Object Creation

Posted By:   Jani_Kaarela  
Posted On:   Thursday, April 28, 2005 02:29 AM

Why would you want to do that? If you want to associate names with Objects, you could put the Objects in a Map, using the name Strings as keys.

Re: Object Creation

Posted By:   WarnerJan_Veldhuis  
Posted On:   Wednesday, April 27, 2005 08:24 AM

I don't see a need for creating variable names at run-time. Please tell me why you do this, and what you want to achieve... It smells like a design flaw...
About | Sitemap | Contact