User Profile

Collapse

Profile Sidebar

Collapse
coolieman
coolieman
Last Activity: Sep 2 '07, 05:42 AM
Joined: Sep 1 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • coolieman
    replied to Trouble with arraylists
    in Java
    No. I'm just a student and I use BlueJ as my compiler. Why do you ask though?...
    See more | Go to post

    Leave a comment:


  • coolieman
    replied to Trouble with arraylists
    in Java
    Thanks for the tip Ganon. I added an "ind--" into all 3 of the if statements and did the trick.

    Now lets say that I want to make the program duplicate all values that are even.

    Ex.

    arraylist = [ 24, 25, 44, 22, 12 ]

    would be turned into

    arraylist = [ 24, 24, 25, 44, 44, 22, 22, 12, 12 ]

    Code:
    for (int ind = 0; ind<nbrs.size(); ind++) {
    ...
    See more | Go to post

    Leave a comment:


  • coolieman
    started a topic Trouble with arraylists
    in Java

    Trouble with arraylists

    Hi, Everyone, recently my programming class has started making programs involving arraylists. Our program is supposed to delete all numbers in the arraylist that contain numbers that end in the number we input and also numbers that are either +1 or -1 from the number.

    Ex.
    arrayList = [43, 59, 87, 60, 67, 25]
    What number do you wish to input?
    8
    arrayList = [43, 60, 25]

    ^ This is the output...
    See more | Go to post
No activity results to display
Show More
Working...