For Loop Booleans
1.
2.
public static void main(String[] args){
Java Expert
Lesson 19/25

Codemoji Terminal Output [Version 1.0.0]
© Codemoji INC 2019. All rights reserved.
Explanation for line 2: bool[] arr = [true, true, false];
An array in Java is defined by a type then '[]'. Arrays are lists of variables that are all stored within a single variable. Arrays in Java can only have elements that are of the same type, for example an int[] array or a String[] array. In order to access a specific variable within an array, the index, or position, of the variable must be used as such: arr[1]. This would return the 2nd element in the array because arrays begin their indexes at 0 instead of 1!
1
2
3
4
5
6
7
8