Horje
how to do two constructors with super Code Example
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;   
}
how to do two constructors with super
public Student(double avgGPA, int ID, String[] classes, String name){
    super(name);
    setVars(avgGPA, ID, classes);
}

public Student(double avgGPA, int ID, String[] classes, String name, int age){
    super(name, age);
    setVars(avgGPA, ID, classes);
}

public Student(double avgGPA, int ID, String[] classes, String name, int age, String homeTown){
    super(name, age, homeTown);
    setVars(avgGPA, ID, classes);
}

private void setVars(double avgGPA, int ID, String[] classes) {
    this.avgGPA = avgGPA;
    this.ID = ID;
    this.classes = classes;
}




Java

Related
make for on all variable in class in java Code Example make for on all variable in class in java Code Example
e Code Example e Code Example
ClassCastException Casting toArray() method Code Example ClassCastException Casting toArray() method Code Example
barcode design in postgresql Code Example barcode design in postgresql Code Example
Volkswagen fox Code Example Volkswagen fox Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10