Thread: If statements
View Single Post
Old 09-17-2002, 09:53 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,529
sde is on a distinguished road
does java support the ternary operator?

it is something i learned in c++, and recently learned that php supports

PHP Code:
<?
($i == 1) ? ($x "i is 1") : ($x "i is not 1");
?>
$first ? $second : $third

above is the format.. if $first is true, then execute the $second expression, else execute the $third expression.
sde is offline   Reply With Quote