check number in array using recursion in java