有参数的构造函数:S s2 = new S("dddd");
无参数的构造函数:S s1 = new S();
带参数的构造方法:
public Person3(String name, String sex, int age ){
this.name = name;
this.sex = sex;
this.age = age;
}
不带参数的构造方法:
public Person3( ){
reture this.con;
}
以上情况如果是调用者创建了一个无参数的构造函数,那么所被调用的那个类会自动创建一个无参数的构造方法(除自动创建无参数构造函数外)
反过来如果调用者创建了一个有参数的构造函数,那么将需要你手动创建构造方法