假设我有一堆 if 语句。
假设其中一个已解决并且其中的代码运行。我是否可以这样做,以便如果我有其他一些失败的条件,它会退出 if 块,但是,继续检查其余的语句。例如
if(condition){
}elseif(condition2){
//If this code runs, but there are some more conditions within it that fail.
//I want the code to continue but
//continue checking condition3 and condition4. Not exiting the whole block with
//continue, nor do I want it to start again.
}elseif(condition3){
}elseif(condition4){
}else{
}
我希望这有点道理。