When i try to compile this:
public static Rand searchCount (int[] x) { int a ; int b ; ... for (int l= 0; l
You declared them at the start of the method, but you never initialized them. Initializing would be setting them equal to a value, such as:
int a = 0; int b = 0;