Computer Applications
Given: String st = (a>= 90)? "Excellent": "Best";
Predict the output, when a = 90.
- Best
- Excellent: Best
- Best: Excellent
- Excellent
Java Operators
25 Likes
Answer
Excellent
Reason — Since condition (a>= 90) of ternary operator is true, st is assigned the value of expression 1 i.e., excellent.
Answered By
16 Likes
Related Questions
Which of the following is the correct precedence of logical operators?
- !, &&, ||
- &&, !, ||
- ||, !, &&
- &&, ||, !
Choose the odd one out from the following:
- >
- ==
- &&
- <
Choose the odd one out from the following:
- Unary operator
- Binary operator
- Ternary operator
- Bitwise operator
Given: x += x++ + ++x + --x
Find the value, when x=5.- 23
- 21
- 22
- 24