I have two number inputs
1010 212
I want to put these into two different arrays ([1 0 1 0] and [2 1 2])
This is my code
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
int Array[] = new int[8];
int Array2[] = new int[8];
int i = 0;
Scanner getNumber = new Scanner(System.in);
do {
Array[i] = getNumber.nextInt();
i++;
} while(getNumber.hasNextInt());
System.out.println(Arrays.toString(Array));
}
}
But I get this as an output
[1010, 212, 0, 0, 0, 0, 0, 0]
(I put 8 as a generic array length because the java compiler forced be to initialize each array)