aspose file tools*
The moose likes Java in General and the fly likes how can i pull out every number from a vector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how can i pull out every number from a vector" Watch "how can i pull out every number from a vector" New topic
Author

how can i pull out every number from a vector

ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
hello there i have this arraylist (arr2) with the values 1, 2, 5 and 10 inside it.
the problem is that i want to get each value out one at a time use i each one seperatly in my if statement (if (i%10 == ((Integer)arr2.get(arr2.size()-1)).intValue()) ) and then use the outcome in diffrent parts of my code.
so for example i want to get the number 1 from the arraylist and then use the outcome in another part of my code and then do the same with the number 2.
if anyone can help it would be great
thanks ben

Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
I'm not sure what you are asking here. In particular, what result do you want to use else where? And where do you want to use it? Your if statement is so complex that it will probably help if you broke it down.


Java API Documentation
The Java Tutorial
ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
hello layne
well when i use the if statement it gets the number 1 from the arraylist (arr2) and that pulls out the 1, 11, 21, 31 words from the vector. which it does ok.
but then i need to change the int value to value that is next in the arraylist (arr2), and so on with the next value from the arraylist untill i have used all the values from the arraylist.
thanks
ben
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
The code above looks a lot like the code in your question on the intermediate message board. I suggest that we focus on one issue at a time here. Let's just continue this discussion in that other thread.
Regards,
Layne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can i pull out every number from a vector