This a Method I am using with my Program
static int check(int pos) {
int i, flag = 0;
for (i = 0; i < pos; i++) {
if (a[pos] == a[i]) {
flag = 1;
return 1;
}
}
if (flag == 0)
return 0;
}
When I compile it, I get the following Error:
Distinct.java:16: error: missing return statement
}
^
1 error