Results 1 to 3 of 3

Thread: loop

  1. #1
    Join Date
    Dec 1969

    Default loop

    Hello,<BR><BR>Depending on a loop count I want to declare different ArrayList objects like<BR>for(int i=0;i&#060;=10;i++)<BR>{<BR>ArrayList Ar0 = new ArrayList();<BR>ArrayList Ar1 = new ArrayList();<BR>:<BR>:<BR>:<BR>ArrayList Ar10 = new ArrayList();<BR>}<BR>but my condition loop may be dynamic(i&#060;=10) so how do I assign the<BR>array name on the fly.......it should start with Ar and followed by the number 0 to end of loop<BR>thanks

  2. #2
    Join Date
    Dec 1969

    Default Don't think you can.

    Maybe with Reflection or something and something like that.<BR><BR>But, why not just have an array of ArrayLists?

  3. #3
    Join Date
    Dec 1969

    Default Use an array of ArrayLists...

    Just like God suggests...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts