Examveda
Examveda

What will be the output of the following Java code?
class ternary_operator 
{
    public static void main(String args[]) 
    {        
         int x = 3;
         int y = ~ x;
         int z;
         z = x > y ? x : y;
         System.out.print(z);
    } 
}

A. 0

B. 1

C. 3

D. -4

Answer: Option C


This Question Belongs to Java Program >> Operators

Join The Discussion

Related Questions on Operators