I'm trying to figure out how to sort a list of input in one array,and make two different arrays out of that, either into even or odd numbers. I can't seem to add the integers to the array in the if-loop.Here is my code: \[code\] Scanner in = new Scanner (System.in);System.out.print("Enter a number"); int number = in.nextInt(); int [] x = new int[0]; int [] even = new int [0]; int [] odd = new int [0];for (int i = 0; i <x.length; i++){ if (in.nextInt() == 0){ for (i = 0; i <x.length; i++) { if (x % 2 == 0) { even = even + x; System.out.print("Even numbers = " + even); i++; } if (x % 2 != 0) { odd = odd + x; System.out.print("Odd numbers = " + odd); i++; } } break; } else { x = number; i++; }}\[/code\]