Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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;   
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #constructors #super
ADD COMMENT
Topic
Name
7+7 =