特点:
1.方法名和类名相同
2.没有返回值
3.在创建一个类的新对象时,系统会自动的调用该类的构造方法完成对新对象的初始化
一个类中可以定义多个不同构造方法;
如果程序员没有定义构造方法,系统能够会自动生成一个默认的无参构造方法(默认的构造方法);
--------------总结
1.构造方法名和类名相同
2.构造方法没有返回值
3.主要作用是完成对新对象的初始化
4.在创建新对象时,系统自动的调用该类的构造方法
5.一个类可以有多个构造方法
6.每个类都有一个默认的构造方法