| Author |
create n number of variables of different name at runtime
|
Pramod P Deore
Ranch Hand
Joined: Jul 15, 2008
Posts: 629
|
|
Hi ranchers I want to create n number of objects ( say String ) of different names then How to do this?
if suppose I use for loop
if suppose n value is 10 here above code creates n String objects. But I want all these String objects name unique. How to do that?
Thanks in advance>
|
Life is easy because we write the source code.....
|
 |
Mohamed Sanaulla
Bartender
Joined: Sep 08, 2007
Posts: 2927
|
|
|
How about using an array? or a Map? So each entry would be your 1 variable. With Map you can give those entries some name as well
|
Mohamed Sanaulla | My Blog
|
 |
Pramod P Deore
Ranch Hand
Joined: Jul 15, 2008
Posts: 629
|
|
|
Thanks Mohamed. I got it. Thanks once again.
|
 |
 |
|
|
subject: create n number of variables of different name at runtime
|
|
|