boolean method
in
Programming Questions
•
1 year ago
I'm trying to find what's wrong with this method, but can't- Processing gives me an error saying that the return type must be boolean... but it is, isn't it?
boolean inArray(int num, int[] ary) {
boolean free = false;
for(int i=0; i < ary.length || free; i++) {
if(num == ary[i]) {
free = false;
}
else {
free = true;
}
return free;
}
}
1