can someone tell me what is wrong with my code? a requirement for divisible with 2 won't pass
package com.codegym.task.task07.task0713;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/*
Playing Javarella
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> main = new ArrayList<Integer>();
ArrayList<Integer> divThree = new ArrayList<Integer>();
ArrayList<Integer> divTwo = new ArrayList<Integer>();
ArrayList<Integer> other = new ArrayList<Integer>();
for (int i = 0; i < 20; i++) {
String s = reader.readLine();
main.add(Integer.parseInt(s));
if (main.get(i) % 3 == 0) {
divThree.add(main.get(i));
} else if (main.get(i) % 2 == 0) {
divTwo.add(main.get(i));
} else {
other.add(main.get(i));
}
}
List a = divThree;
List b = divTwo;
List c = other;
System.out.println(a);
System.out.println(b);
System.out.println(c);
}
public static void printList(List<Integer> list) {
//write your code here
for (Integer l : list) {
System.out.println(l);
}
}
}