方法引用

package mdthob;

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

public static int max(int num1,int num2){
int ax = 0;
if(num1==num2){
System.out.println("没得玩咯");
return 0; //终止方法
}
if(num1>num2){
ax=num1;
}
else {
ax=num2;
}
return ax;
}
}
posted @ 2023-02-13 16:26  小小的羊  阅读(14)  评论(0)    收藏  举报