I read the book and read that by default variables of type boolean are false . Therefore, if I create an array of four false values, is it enough for me to simply write like this?

 boolean[] flags = new boolean[4]; 

And if so?

 Boolean[] flags = new Boolean[4]; 

Or in the array this rule does not work? Will it be null ? If it works, where does it not work?

    1 answer 1

    Boolean is an object and will be null for it. boolean is a primitive, and it will be false

    • Thank you, I have read it myself and understood :) - Flippy