Vidyalelo
Java Programming · Q98

Operators

Programming · Java Programming · question 98

Q98

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
Answer
D.
-4

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board