Ternary operator of Java
•
Java
Logical operation? m : n; If the logical operation is true, M is returned; otherwise, n is returned
example:
Judge the size of I and J. if a is large, output 1, otherwise output 0;
Find the maximum value of I, J and K;
Output:
one
three
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码