北小柒

导航

 
public class Demo01{
public static void main(String[] args){
int max = max(10,10);
System.out.println(max);

}
public static int max(int num1,int num2){
int result = 0;
if(num1==num2){
System.out.println("num1==num2");
return 0 ;//返回值,一种终止方法
}
if (num1>num2){
result = num1;
}else {
result = num2;
}
return result;
}
}
posted on 2021-10-17 16:32  北小柒  阅读(20)  评论(0)    收藏  举报