| Author |
boolean return question
|
Quang Pham
Ranch Hand
Joined: Nov 29, 2005
Posts: 47
|
|
Hi Can some one explain the following code: boolean a = false; boolean b = false; boolean c = false; public boolean isOptionValid(){ return a||b||c; } Thanks
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 10040
|
|
the || operator means "shortcut logical OR". do you know your boolean logic rules? a OR b OR c since in this case all three are false, the result is false, so false is returned.
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
 |
|
|
subject: boolean return question
|
|
|