は、私はエラーを取得するスーパークラス(人)&サブクラス(学生)サブクラスのコンストラクタ
public class Person{
private String name;
private Date birthdate;
//0-arg constructor
public Person() {
birthdate = new Date("January", 1, 1000);
name = "unknown name";
}
//2-arg constructor
public Person(String newName, Date newBirthdate){
this.name = newName;
this.birthdate = newBirthdate;
}
//Subclass
public class Student extends Person{
public Student(){
super(name, birthdate)
}
を作成しました。 私が試した:
public Student(){
super()
}
を私のコーステスターは、私はあなたがパラメータとして名前と誕生日を取る学生のコンストラクタを作成する必要がありますsuper(name, birthdate);
私はすでに2つのパラメータコンストラクタを持っています。 0パラムコンストラクタでスーパー(名前、生年月日)を使用する必要があります – user1200325
@ user1200325 - 私は私の答えを改訂しました –