深入:

public class MethodTest05{
public static void main(String[] args){
int i=m1(ture);

System.out.println(i);

System.out.println(m1(false));


}
public static int m1(boolean flag){
/*
if(flag){
return 0;
}else{
return 1;
}

*/

//升级
if(flag){
return 0;
System.out.println("Test");//无法访问,因为该句上面的return一致性方法就结束了,所以编译无法通过。
}
return 1;

 


}
}

相关文章:

  • 2021-11-11
  • 2021-07-12
  • 2022-12-23
  • 2021-10-22
猜你喜欢
  • 2021-11-29
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2021-12-17
相关资源
相似解决方案