OK so in this program I'm making I have to check if all of the values in the Array are greater than a specific number.
this is what i have so far
public static boolean isGameOver(){
int check = 0;
for(int k = 0; k < data.length; k++){
if (data[k] >= limit)
check++;
}
if (check == data.length)
return true;
else
return false;
}
the limit variable is the number that all the number in the array have to be grater or qual to.
Can you help me fix this and explain why my way doesn't work?