| | |
Inverting value of boolean variable?
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jan 2008
Posts: 3,844
Reputation:
Solved Threads: 503
•
•
•
•
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
Views: 651 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Java
3d @param affinetransform android api apple applet application arc arguments array arrays automation binary bluetooth byte c# chat class classes click client code color compare component corrupted database detection draw eclipse error event exception file fractal game givemetehcodez graphics gui guitesting helpwithhomework html ide image input integer j2me java java.xls javaprojects jmf jni jpanel julia keytool linux list loop map method methods mobile netbeans newbie number object oracle pong print problem producer program programming project projectideas read recursion reflection replaysolutions rim scanner screen server set size sms socket sort sql string swing terminal test threads time transfer tree web windows






