When i try to compile this:
public static Rand searchCount (int[] x) { int a ; int b ; ... for (int l= 0; l
Imagine what happens if x[l] is neither 0 nor 1 in the loop. In that case a and b will never be assigned to and have an undefined value. You must initialize them both with some value, for example 0.