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

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation