在java中编写If语句的另一种方法 [英] Another way of writing If statement in java

查看:172
本文介绍了在java中编写If语句的另一种方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

什么是Java?:运算符被调用,它做了什么?

也许这是其他一些问题的重复问题,但我找不到。

Maybe this is a duplicated question to some other questions here but I could not find it.

昨天我看到一个人使用新的方式编写if语句,使用,我不确定他们都是什么意思。

Yesterday I saw a guy using a new way of writing the if statement by using ? and : and I'm not sure what do they all mean.

如果有人可以指出我的教程或已经回答的问题我会非常感激。

If someone could point me out to a tutorial or an already answered question I would so much appreciated.

推荐答案

条件运算符,它是一种三元运算符

The conditional operator, it's a type of ternary operator

维基百科 - ?:

wikipedi a - 三元操作

这篇关于在java中编写If语句的另一种方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆