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);
}
}
1
0
2
1
3
3
4
-4
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);
}
}