Check if all lotto numbers are covered in input
First, this will not work with the input 99.  Arrays are 0-indexed, but when you create one, you need to specify the value you wish .length to have, which is 100.

This part is also erroneous:

while (ticketNumber != 0) {
    for (int i = 1; i &lt;= neededNumbers.length; i++) {
        neededNumbers[i] = true;
    }
    ticketNumber = input.nextInt();
}


Here, you input the values until the input equals 0, but you loop from 1 through needeNumbers.length and set the values to true.  First off, this will crash when you run it because the value neededNumbers[neededNumbers.length] does not exist.  Additionally, your logic is wrong as you do not want all the values of neededNumbers to be set to  true, just the input ones:

while (ticketNumber != 0) {
    neededNumbers[ticketNumber] = true;
    ticketNumber = input.nextInt();
}


This loop is almost right, but you check the value an index 0, which you did not set to true because 0 was the value to exit the loop:

for (int i = 0; i &lt; neededNumbers.length; i++) {
    if (neededNumbers[i] == false) {
        System.out.println("You do not have all the numbers.");
        System.exit(0);
    }
}


You can solve this problem in one of two ways - starting with i = 1, or changing your while loop to use neededNumbers[ticketNumber - 1] = true; and intializing it to new boolean[99], like you currently do.  This will have value 1 be stored in the 0 index of the array, so all values will be set to true once all the numbers in the range of 1 - 99 have been entered.