When i try to compile this:
public static Rand searchCount (int[] x) { int a ; int b ; ... for (int l= 0; l
You haven't initialised a and b, only declared them. There is a subtle difference.
a
b
int a = 0; int b = 0;
At least this is for C++, I presume Java is the same concept.