Java重载 Java将阵列更改为列表 Java方法隐藏 Java重载 public class Sample{ public int add(int a, int b){ int c = a+b; return c; } public void add(int a, int b, int c){ int z = a+b+c; System.out.println(z); } public static void main(String args[] ){ Sample obj = new Sample(); System.out.println(obj.add(40, 50)); obj.add(40, 50, 60); } } Java将阵列更改为列表 Java方法隐藏