• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating Stings Dynamically  RSS feed

 
Steve Dyke
Ranch Hand
Posts: 1780
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to loop through an array and create String objects. How can I get this to work?

>
 
Marky Vasconcellos
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's impossible.

I found the same question a while ago in other forum.
But.. i suggest you store all it on a ArrayList and to access you can use it using the get(int index) from the List interface.
 
Malcolm Storey
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It really depends on what you're trying to achieve. If you just want some sort of formatting on the original objects, give them a method to return an appropriately formatted String.

 
Rob Spoor
Sheriff
Posts: 21131
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need the contents of each "variable" as well, try a map:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!