public class Day24_4 {
// 方法重载 同类中有多个方法名相同但是参数列表不同
// 方法一
public void getsum(int a,int b) {
System.out.println(a+b);
}
// 方法二 参数个数不同
public void getsum(int a,int b,int c) {
System.out.println(a+b);
}
// 方法三 参数数据类型不同
public void getsum(byte a,int b) {
System.out.println(a+b);
}
// 方法四 参数数据类型不同
public void getsum(byte a,byte b) {
System.out.println(a+b);
}
// 方法三 参数顺序不同
public void getsum(int b,byte a) {
System.out.println(a+b);
}
}