没有在Course类中添加无参构造器,使用ChildCourse类继承Course类也没有报错,怎么回事?
public class Course {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
public class ChildCourse extends Course {
}