Q:
class Hell {
public static void main(String[] args) {
Integer i = 42;
String s = (i<40)?"life":(i>50)?"base":"ball";
System.out.println(s);
}
}
Answer & Explanation
Answer: B) ball
Explanation: D is correct. This is a ternary nested in a ternary with a little unboxing thrown in.Both of the ternary expressions are false.
View Answer
Report Error
Discuss