Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By killutch

Thread: Can you use ArrayList to populate and output an array multiple times?

  1. #1
    mc54321 is offline Member
    Join Date
    Oct 2012
    Posts
    7
    Rep Power
    0

    Default Can you use ArrayList to populate and output an array multiple times?

    My program is supposed to take the user's input for a series of questions, using an array. It should ask that series of questions twice, before outputting anything, and then output both sets of answers together. So if the user enters "A", "B", "C" the first time, and then "C", "B", "A" the second time, the output should read:

    A
    B
    C

    C
    B
    A

    Can you use ArrayList to do this? Or is there some other way to store multiple sets of values for the same array?


    Thank you.

  2. #2
    killutch is offline Member
    Join Date
    Sep 2012
    Posts
    70
    Rep Power
    0

    Default Re: Can you use ArrayList to populate and output an array multiple times?

    I would use an ArrayList if you don't know how many times the user will input something.
    quad64bit likes this.

Similar Threads

  1. How to prevent printing the same output 5 times
    By gabrielpr12 in forum New To Java
    Replies: 4
    Last Post: 01-13-2012, 09:47 PM
  2. write line multiple times
    By relith in forum New To Java
    Replies: 3
    Last Post: 10-27-2010, 08:38 AM
  3. Issue with saving multiple times to a variable
    By sidd0123 in forum New To Java
    Replies: 3
    Last Post: 06-06-2010, 02:02 AM
  4. calling action class multiple times
    By sindhu_shiva in forum Web Frameworks
    Replies: 0
    Last Post: 08-07-2009, 02:44 PM
  5. Playing an AudioInputStream multiple times
    By pmgallardo in forum Advanced Java
    Replies: 6
    Last Post: 03-09-2009, 04:29 PM

Posting Permissions

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