没有else语句的if语句是不是很糟糕? [英] Is it bad to have if statements without else statements?
本文介绍了没有else语句的if语句是不是很糟糕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我很想知道在java中没有else语句的if(){}构造是否是一件坏事。
I was just curious to know if its a bad thing to have an if(){} construct without an else statement in java.
推荐答案
当然不是。有几次你只需要if语句而没有相应的else。
No of course not. There are several times when you only need an if statement without a corresponding else.
这篇关于没有else语句的if语句是不是很糟糕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文