本文介绍了Java“? :"运营商?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以知道什么是java?:运算符调用,我试图找到它是如何工作的信息,但我不知道它叫什么,输入?:在google中没有给出正确的结果。

may i know what is the java ?: operator called, i am trying to find information on how it works but i do not know what is it called, typing ?: in google dont give a correct result.

推荐答案

这是条件运算符。

有些人称之为三元运算符,但这只是说它有多少个操作数。特别是,Java的未来版本可以(完全合理地)引入另一个三元运算符 - 而运算符的 name 是条件运算符。

Some people call it the ternary operator, but that's really just saying how many operands it has. In particular, a future version of Java could (entirely reasonably) introduce another ternary operator - whereas the name of the operator is the conditional operator.

见:

这篇关于Java“? :"运营商?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 18:44