- 博客(1)
- 收藏
- 关注
原创 Java and Me --HDU轩少
方法重载(Overload) 1.定义:完全不同的方法,但是名称都相同并且与类名一致。 2.构成重载的条件: (1)形参类型,形参个数,形参参数类型顺序不同 例如 public class Animal{ private int age; private String color; //重载方法 public Animal(){ System.out.println("我是动物"); } public Animal(int age){ System.out.println("我8岁了"
2020-08-02 21:01:20 183
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人