cool.
--- Update ---
Found a solution (?) to the problem.
...
ArrayList <Integer> numbers = new ArrayList<Integer>();
int position=0;
int maxNum= 0;
for (i=0; i<5;i++) {
numbers.add((int)(Math.random()*10)+1);
}
for (i=0;i<numbers.size();i++){
if (numbers.get(i) > maxNum) {
position=i;
maxNum = numbers.get(i);
}
}
numbers.remove(position); //removes the index that contains the maximum number along with the value in it
System.out.println("Maximum number: " + maxNum);
System.out.println("Found max at index " + position);
//what this does is iterate through the NEW set of numbers after the maximum has been removed, and it finds the same number,it simply removes it.
for (i=0;i<numbers.size();i++){
if (numbers.get(i) == maxNum) {
position=i;
numbers.remove(position);
//maxNum = numbers.get(i);
}
}