|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|
Re: Ternary operators
Instead of using the ternary operators or the if statements in your examples, why don't you just return the value of the boolean going into the if or ternary?
Instead if this: Code:
boolean getState() {
if(this.thing.state) {
return true;
else {
return false;
}
}
Code:
boolean getStateTernary() {
return this.thing.state ? true : false;
}
why not just this? Code:
boolean getState() {
return this.thing.state;
}
|
| 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 |