Java方法(类--------对象--------方法)

 

 

 

 

public static void main(String[] args) {
int B = max(10, 10);
System.out.println(B);
}
public static int max(int num1,int num2){
int A= 0;
if (num1>num2){
A=num1;
}else {
A=num2;}
if (num1==num2){
System.out.println("相等");
return 0;//终止方法;
}

return A;

}


}
posted @ 2020-05-29 17:52  光光1234  阅读(117)  评论(0编辑  收藏  举报