I have looked in many places online and all seem to give me the same solution. So it's obvious that I have made some sort of silly mistake I cannot see. Can someone please point me in the right direction. Thanks a mill.
Here is my code:
import java.util.Arrays;
public class Solution {
public static void main(String[] args) {
int[] outcomes = {1, 2, 3, 4, 5, 6};
int count = 0;
for(int y = 1; y<=6; y++){
if(Arrays.asList(outcomes).contains(y)){
count++;
System.out.println("outcomes contains "+ y);
}
}
System.out.println(count);
}
The final output should be 6 but it is 0.