1public static boolean contains(ArrayList<Integer> list, int value) {
2 return contains(list, value, 0);
3}
4
5private static boolean contains(ArrayList<Integer> list, int value, int idx) {
6 boolean hasInt = false;
7
8 if (idx < list.size()) {
9 if (list.get(idx) == value) {
10 hasInt = true;
11 } else {
12 hasInt = contains(list, value, idx + 1);
13 }
14 }
15
16 return hasInt;
17}