1
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);

}

}

A) null B) ball
C) base D) None

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.

Subject: Java - Technology
Q:

What is the most important feature of Java?

Answer Java is a platform independent language.
Report Error

View answer Workspace Report Error Discuss

Subject: Java - Technology

0 2980