I want to delete Even numbers from arrayList , my code works fine as in i can add and print values of the arrayList. However when i want to loop through the ArrayList and delete even numbers i get stuck. This is what i have come up with so far but dont know where to go forward
for (int i = 0; i < userNumber.size(); i++) {
System.out.println(userNumber.get(i));
if (userNumber(i) % 2 == 0) {
//
}
}
I was thinking that if the remainder of the number is 0 on each index of the Arraylist, then we can use the userNumber.remove(); Not sure how to implement that however..