wood burning stoves 2.0*
The moose likes Java in General and the fly likes help with a statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "help with a statement" Watch "help with a statement" New topic
Author

help with a statement

ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
hello everyone i hope someone can help me
I have this code which prints out a line from the csv file but if you look at my code. Where it says if (i%10 == ((Integer)arr2.get(arr2.size()-1)).intValue())
this will read in the last item that is in the arraylist (arr2) by getting the integer value.
but i want it to read out all the values that are inside the arraylist arr2 how could i do this?
please could some one help me
thanks
ben
Irene Loos
Ranch Hand

Joined: Apr 15, 2002
Posts: 78
Instead "-1" in your code:
if (i%10 == ((Integer)arr2.get(arr2.size()-1)).intValue())
use variable that you will increment/decrement to the size of your array.
Hope this will help.


Irene Loos
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: help with a statement