KnowledgeBoat Logo
|

Computer Applications

Given: String st = (a>= 90)? "Excellent": "Best";
Predict the output, when a = 90.

  1. Best
  2. Excellent: Best
  3. Best: Excellent
  4. 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