Facebook

adsense

Tuesday, 28 April 2015

QUESTION 5

What results from attempting to compile and run the following code?

public class Ternary
{
    public static void main(String args[])
    {
        int a = 5;
        System.out.println("Value is - " + ((a < 5) ? 9.9 : 9));
    }
}
-----------------------------------------------------------------------------------
A.  prints: Value is - 9
B.  prints: Value is - 5
C.  Compilation error
D.  None of these
                        <PREVIOUS || Main Page || NEXT >
    Give your answers in the comment below

No comments:

Post a Comment