Q. What will be the output of the following Java code?
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);
}
}
β
Correct Answer: (C)
3