![]() |
| ||
| Creating Objects With User specified Name HI Folks , Sorry if it is the Repeated Question.... ---> I want to Create An Object for a Class With user specified name.? Example : Class Name : Simple User Specified Name for a Object : SunServer i want like this Simple "userSpecified Name" = new Simple(); how to replace the "userSpecified Name " variable in the above line with SunServer.. String UserSpecified = SunServer; :'( Simple UserSpecified = new Simple();:'( Above line is Wrong bcz we already defined UserSpecified Variable as a String Type and we cant create an Object for a class(Simple) with same variable. i want to do create Objects with name as User specified "Something like at Runtime" . |
| ||
| Re: Creating Objects With User specified Name are you wanting dynamic variable names? if so you can't do that in java you can use an ArrayList or HashMap to store a name and a class String userSpecifiedName = "SunServer"; |
| ||
| Re: Creating Objects With User specified Name thanks man i got it |
| All times are GMT -4. The time now is 2:47 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC