I read on how to use the continue statement, but I'm failing in how to use it properly, mostly because it's not working. I'm supposed to print out what numbers are showing up and how many times for each. Plus, I have to print out 'times' instead of 'time' if there's more than one of a certain number. Right now, it's printing out all the numbers including the ones that don't get inputted. Help please.
import java.util.Scanner; public class occurrence { public static void main(String[] args) { //scanner/values Scanner input = new Scanner(System.in); int number = 101; //array int[] allNum = new int[number]; //for loop, user input for(int i = 1; number != 0; i++) { System.out.print("Please enter integers from 1 to 100, enter 0 when finished: "); number = input.nextInt(); allNum[number]++; } //printout for(int j = 1; j <= 100; j++) { if (allNum[number] == 1) { System.out.println(j + " shows " + allNum[j] + " time."); } else if (allNum[number] > 1) { System.out.println(j + " shows " + allNum[j] + " times."); } if (allNum[number] == 0) { continue; } } } }