Java: Ternary Operator

preview_player
Показать описание
Java ternary operator is the only conditional operator that takes three operands. It’s a one-liner replacement for the if-then-else statement and is used a lot in Java programming. We can use the ternary operator in place of if-else conditions or even switch conditions using nested ternary operators. Although it follows the same algorithm as of if-else statement, the conditional operator takes less space and helps to write the if-else statements in the shortest way possible.
0:05 Description
1:23 Using (example 1)
2:46 Using (example 2)
Рекомендации по теме
welcome to shbcf.ru