I am not sure, but I think your array holds no values in it. And you try to compare the number with the values within the array, which do not exist.
And besides that, array = num.nextInt(); gives...