📜  如何用 super 做两个构造函数 - 任何代码示例

📅  最后修改于: 2022-03-11 14:54:59.639000             🧑  作者: Mango

代码示例2
public Person(String name){
    this(name, 18, "Atlanta");
}

public Person(String name, int age){
    this(name, age, "Atlanta");
}

public Person(String name, int age, String homeTown){
    this.name = name;
    this.age = age;
    this.homeTown = homeTown;   
}