|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Ternary operators
Was I the only one that used these on the robot?
For those not in the know, Ternary operators are essentially an inline if statment. Example using if statements, like mama told you to do so: Code:
boolean getState() {
if(this.thing.state) {
return true;
else {
return false;
}
}
Code:
boolean getStateTernary() {
return this.thing.state ? true : false;
}
The layout is: Code:
variable = [boolean condiditon] ? [if its true] : [if its false]; Did anyone else use these? |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling all Hams--Amateur Radio Operators | Covey41 | General Forum | 8 | 09-04-2007 19:45 |
| Do you use ternary operators in your code? | NotQuiteFree | Programming | 14 | 07-04-2004 11:21 |
| How about a Drivers/Operators page and a Human Players page | Anthony S. | CD Forum Support | 4 | 02-06-2001 22:47 |