So if you want to have lots of booleans but not waste memory, use a BitSet
if it's sure its reference won't escape/survive its local scope boundary!
Note that this is more involved than one might expect, and in my experience happens infrequently.
I wanna know is there anyway that I can edit the original variable with another variable in the same way that c++ does it or should I just build setting methods.
Note that you can store fields in some kind of Reference type (even something as simple as a 1-element array) to (crudely) simulate this functionality.
The provided atomic impl is actually pretty useful at times: https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicReference.html