I use a buffered reader to read in the input and then it adds it to an array. But for some reason it only adds the last input to the array. I also want to check if the first input is zero... so thats what I am doing with the check variable. But the main problem is that it doesn't add it to the array.
public static void main (String[] Args) throws IOException
{
int[] numbers = new int[100];
Scanner scan = new Scanner(System.in);
InputStreamReader isReader = new InputStreamReader(System.in);
BufferedReader bReader;
bReader = new BufferedReader(isReader);
int intNumber = Integer.parseInt(bReader.readLine());
int check = scan.nextInt();
while (check != 0)
{
int i = 0;
numbers[i] = Integer.parseInt(bReader.readLine());
check = intNumber;
i++;
}
bReader.close();
}