当前位置: 代码迷 >> 综合 >> return的一种用法:如果当前判断为true则跳出这个方法。
  详细解决方案

return的一种用法:如果当前判断为true则跳出这个方法。

热度:26   发布时间:2023-10-30 13:33:17.0
package rom;
import java.lang.*;
/** return的一种用法:如果当前判断为true则跳出这个方法。*/
public class Xamle_5 {
static boolean a = true;
public void data() {
if(a==true) {
return;
}
System.out.println("data方法被执行");
}public static void main(String [] args) {
new Xamle_5().data();}}

  相关解决方案