how to change value of boolean in java code example Example: java change boolean to opposite theBoolean = !theBoolean;