File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

create n number of variables of different name at runtime

 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
Mohamed Sanaulla
Saloon Keeper
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mohamed. I got it. Thanks once again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic