There is a much better way of doing it, by taking the count variable out. This should also do it:
public static int displayOccu(int a, int n, int i)
if(i == a.length)
else if(a[i] == n)
This code is very similar to examples of summation with recursion. If the number is a hit, we add one and check the rest, otherwise we just check the rest. When it reaches the end of the array, it returns 0 to the previous call, and then adds together each 1 as the recursive call returns to where it was called.
I haven't compiled or tested the code, but in theory it should work.