【发布时间】:2013-09-28 03:15:21
【问题描述】:
我正在尝试实现这个逻辑,我只是想知道是否有更好的方法?
if(condition1) {
do1();
}
else if(condition2) {//especially here that I have to check condition3 here and also in the last else if
do2();
if(condition3) {
do3();
}
}
else if(condition3) {
do3();
}
【问题讨论】:
-
条件2和条件3是否互斥?
-
@Bathsheba 不,它们可以同时发生
-
你能发布一些实际情况吗?
-
在什么意义上更好?
标签: java if-statement conditional-statements