What will be the output of this ternary operation?

Last Updated :
Discuss
Comments

What will be the output of this ternary operation?

Java
int a = 10, b = 20;
int min = (a < b) ? a : b;
System.out.println(min);


10

20

Compilation Error

Undefined Behavior

Share your thoughts in the comments