Mutable boolean field in Java

Immutable classes are easier to work with. They’ll never change and there will be no problems with concurrent code. (Basically, there are fewer possibilities to break them.)

If you would like to return a reference to your Boolean value, you can use java.util.concurrent.atomic.AtomicBoolean if you’re working with multiple threads or plain old org.apache.commons.lang.mutable.MutableBoolean.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)