| | |
Inverting value of boolean variable?
Thread Solved
![]() |
•
•
Join Date: Jan 2008
Posts: 3,765
Reputation:
Solved Threads: 494
•
•
•
•
Hi guys,
I am using boolean variables as flags in a program and i want to be able to invert the value.
for example if the current value is true, then it must be changed to false; doesn't matter if i don't know what the current value is.
Java Syntax (Toggle Plain Text)
boolean a = true; System.out.println (Boolean.toString(a)); // true a = !a; System.out.println (Boolean.toString(a)); // false
![]() |
Similar Threads
- Return Boolean to main (Java)
- Retrieving Form Variable (Visual Basic 4 / 5 / 6)
- Accessing boolean Values of another values in one class. (Java)
- problems with variable accumulation (VB.NET)
- Finding Prime numbers without using Boolean (C++)
- how to pass class variable to another class (Java)
- What is the size of a boolean variable (Java)
- Any Boolean Expression to Sum of Minterms (C++)
Other Threads in the Java Forum
- Previous Thread: Penny Pitch Game
- Next Thread: Please help me with the program code
| Thread Tools | Search this Thread |
-xlint actionlistener android api applet application array automation bi binary blackberry block bluetooth character class client code compile compiler component consumer database desktop developmenthelp eclipse error fractal freeze ftp functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide image int j2me j2seprojects java javac javaee javaprojects jetbrains jni jpanel jtable julia learningresources lego linked linux mac main map method mobile myregfun netbeans nonstatic notdisplaying number online pearl printf problem program project qt researchinmotion rotatetext rsa scanner screen server set singleton sms sort spamblocker sql string swing system textfields thread threads time title tree tutorial-sample update variablebinding windows working xor






