In java, is it possible to make an Array of booleans that when any boolean is set to a specified value,(example, false) all are set to the same value. (if ones value is false, all values will be set to false.)
I will be having a loop that keeps adding more to the Array, so individual setting is not an option.
Any help is appreciated. I am not going to post code.
There is a method that fills an array of booleans with the selected value, this might be what you are after:
Arrays.fill(boolean[] a, boolean val)Assigns the specified boolean value to each element of the specified array of booleans.