Answers for "constructor and supper"

0

how to do two constructors with super

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;   
}
Posted by: Guest on July-23-2020

Code answers related to "constructor and supper"

Browse Popular Code Answers by Language