更新时间:2023-02-06 18:06:14
Java三元操作条件的使用应该类似于
Usage of Java ternary operation condition should looks like
result = testCondition ? value1 : value2
它是java语言规范。
it's java-language specification.
在以下示例中,
此运算符应该读作:如果 someCondition 是 true ,请将 value1 的
值分配给结果。否则,赋值 value2 到
结果
In the following example, this operator should be read as: "If someCondition is true, assign the value of value1 to result. Otherwise, assign the value of value2 to result