Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java initialize dynamic array of boolean

// Load List of Boooleans, from console, using streams:
List<Boolean> 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());
}
 
PREVIOUS NEXT
Tagged: #java #initialize #dynamic #array #boolean
ADD COMMENT
Topic
Name
9+3 =