A类:
public class A {
private String firstName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
B类:
public class B extends A{
private int billNum;
B(String firstName, String billNum) {
super(firstName);
setBillNum(billNum);
}
public int getBillNumr() {
return billNum;
}
public void setBillNum(int billNum) {
this.billNum = billNum;
}
1.)现在我想添加一个像构造函数一样的默认值B() {}
,但我不允许这样做。为什么是这样 ?