What will be integer printed in the output of the below given statements in Java?

int a = 0, b = 2;

int tb = b == 0 ? 10 : 20;

System.out.println(“Ternary operator: ” + tb);

1
0
2
2
3
10
4
20

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation