It is written x ? y : z.
The correct syntax for the ternary operator in Java is:
sql
condition ? expression1 : expression2
So, in your case, the correct syntax is:
yaml
x ? y : z
Technical Interview Questions
It is written x ? y : z.
The correct syntax for the ternary operator in Java is:
condition ? expression1 : expression2
So, in your case, the correct syntax is:
x ? y : z