Computer Science, asked by AryanKapoorLucknow, 5 months ago

int num=false?10:20
system.out.println(num)

Answers

Answered by rkesh2003
0

Answer:

20

Explanation:

The ternary operator in Java checks for true or false. And choose the first value if the condition is true and if false chooses the second.

In, int num = false?10:20, the condition itself false, it prints 20

Similar questions