The title describes the question. Here's the code:
boolean planeArray[][];
Just with
boolean planeArray[][] = new boolean[rows][columns];
all values will be false by default.
You can also initialize with the number of rows:
boolean planeArray[][] = new boolean[rows][];
and then assign each row an 1D-array:
planeArray[0] = new boolean[columns];
...
Note that by using this last way, rows can have different number of columns.
You have to initialize the array and the default value of boolean will be set to all the indexs element which is false.
boolean planeArray[][] = new boolean[row_size][column_size];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With