Java Ternary operator

The value of a variable often depends on whether a particular Boolean expression is or is not true.
Java ternary operator let’s you assign a value to a variable based on a boolean expression.Ternary operator (also known as the conditional operator) can be used as an alternative to the Java if-then-else syntax.

[Read more…]