📅  最后修改于: 2022-03-11 14:52:14.753000             🧑  作者: Mango
// Load List of Boooleans, from console, using streams:
List booleans = Arrays
.stream(scanner.nextLine().split("\\s+"))
.map(Boolean::parseBoolean)
.collect(Collectors.toList());
// Load ArrayList of Boooleans, from console, using streams:
ArrayList booleans = new ArrayList<>();
while (scanner.hasNextBoolean()) {
booleans.add(scanner.nextBoolean());
}