Start of Tutorial > Start of Trail > Start of Lesson | Search |
The Java programming language supports one ternary operator--the?:
operator. This operator is a conditional operator and is short-hand for anif
-else
statement:Theop1 ? op2 : op3?:
operator returnsop2
ifop1
is true or returnsop3
ifop1
is false.
Start of Tutorial > Start of Trail > Start of Lesson | Search |