Q. What is the output of the Java code snippet with Ternary operator?
Code:int num = false?10:20; System.out.println(num);
β
Correct Answer: (B)
20
int num = false?10:20; System.out.println(num);
You must be Logged in to update hint/solution