Results 1 to 4 of 4

Thread: Hi new here :)

  1. #1
    pyzzer is offline Member
    Join Date
    Sep 2011
    Posts
    2
    Rep Power
    0

    Default Hi new here :)

    Hi!

    Im new here at the forum and new to programming Java. I have searched and have not found the answer.
    Im trying to make a arraylist with a random length. it supposed to be like this:
    Java Code:
    ArrayList<Integer> list = new ArrayList<Integer>();
    if(int i; i < "the randomlength of" list; i++){
    system.out.print("testing");
    }
    someone please help me, Google wont help me :(

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,776
    Blog Entries
    7
    Rep Power
    21

    Default Re: Hi new here :)

    Bookmark this link and pay attention to the Random class and its methods.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Hi new here :)

    Also, learn the difference between an if statement and a for loop.

    db

  4. #4
    pyzzer is offline Member
    Join Date
    Sep 2011
    Posts
    2
    Rep Power
    0

    Default Re: Hi new here :)

    Sorry its supposed to be "for(int i ...." ^^ typo.

Posting Permissions

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