package method; public class Demon03 { public static void main(String[] args) { int maxnum=max(10,20); System.out.println(maxnum); } //比大小 public static int max(int a, int b){ int result=0; if(a==b){ System.out.println("a=b"); return 0;//终止方法 } if(a>b){ result=a; }else{ result=b; } return result; } }