Q:

How to have an array of volatile booleans in Java and not a volatile array of booleans?

So I want an array with 10 volatile booleans, not a volatile array with 10 booleans. It probably does not even make sense to have a volatile array reference, correct me if I am wrong.

A:

I believe the only way is to have a AtomicBoolean[] or an AtomicIntegerArray. Then they do not need to be volatile. Its elements will be.
If you want more fun, check this question: Which is "better". AtomicIntegerArray (1/0 as true/false) versus AtomicBoolean[]?

