🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
### overload 根据参数的不同,调用不同的方法,就是重载 . ~~~ public class Dome{ public static void main(String[] args) { System.out.println(show(1,2,3)); } public static int show(int a, int b) { return a*b; } public static int show(int a,int b,int c) { return a+b+c; } } ~~~ **注意** 1. 参数列表必须不同 . 2. 重载和参数变量名无关 . 3. 重载和返回值类型无关 . 4. 重载和修饰符无关 . 5. 重载只看方法名和参数列表 .