// If you read array of unknown length, from console
// and you want to put numbers into array of fixed length
long[] array = Arrays.stream(scanner.nextLine().split(" "))
.mapToLong(Long::parseLong)
.toArray();
int[] array = Arrays.stream(scanner.nextLine().split(" "))
.mapToInt(Integer::parseInt)
.toArray();