I am trying to write a method that when invoked, changes a boolean variable to true, and when invoked again, changes the same variable to false, etc.
For example:
call method -> boolean = true -> call method -> boolean = false -> call method -> boolean = true
So basically,
if (a = false) { a = true; }
if (a = true) { a = false; }
I am not sure how to accomplish this, because every time I call the method, the boolean value changes to true and then false again.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…