Search Interview Questions
| 3358 questions in repository.|
There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
|Java - Interview Questions and Answers|
|Ans. Ternary operator , also called conditional operator is used to decide which value to assign to a variable based on a Boolean value evaluation. It is used as |
condition ? value1 : value2
int y = (x > 0) ? x:0; // assign x if it's greater than 0, else assign 0
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve  operator  ternary operator Basic|