In this method I am trying to find a first even integer in an ArrayList
(for further use).
However, when I am calling the method I get -1. As much as I know, this means that there is no integer in the list (but there actually are).
Here is the code:
public static int rangeBetweenEvens(ArrayList<Integer> list) {
int firstEven = 0;
for (int i = 0; i < list.size(); i++)
{
firstEven = list.indexOf((i) % 2 == 0);
}
return firstEven;
}