How to jump out of if in java
We often use if statements when writing code. When if() is judged as When it is true, the statement after the if will be executed. When it is judged to be false, it will not be executed.
If we want to jump out of multiple if statements, how should we do it? Here is a method to jump out of multiple if statements. (Recommended tutorial: java tutorial)
1. Normal logical judgment is written like this
if(...){ // do something // 如果为true进入 if(condition==true){ // do something // 以下有多行代码 } }
2. Use break to jump out of multiple if
标签1: if(...) { // do something if(condition==false) break 标签1; // do something // 以下有多行代码 }
The above is the detailed content of How to jump out of if in java. For more information, please follow other related articles on the PHP Chinese website!