Ternäre Operator Java code example
Example 1: java ternärer operator
variable = bedingung ? wert1 : wert2
Example 2: ternärer operator java
final String msg = num > 10
? "Number is greater than 10"
: "Number is less than or equal to 10";
variable = bedingung ? wert1 : wert2
final String msg = num > 10
? "Number is greater than 10"
: "Number is less than or equal to 10";