package FeiGe;
public class Customer extends Person{
private String customerId;
private String phone;
public Customer(){
}
public Customer (String CustomerId , String phone){
super() ; //调用父类构造方法, 可写可不写
this.customerId = customerId;
this.phone = phone;
}
public Customer(String name , String sex , String pwd , int age , String customerId , String phone){
super( name , sex , pwd , age);
this.customerId = customerId;
this.phone = phone;
}
public String getCustomerId(){
return customerId;
}
public void setCustomerId(String customerId){
this.customerId = customerId;
}
public String getPhone(){
return phone;
}
@Override
public String toString() {
return "Customer{" +
"customerId='" + customerId + '\'' +
", phone='" + phone + '\'' +
'}';
}
public void setPhone(String phone){
this.phone = phone;
}
}
package FeiGe;
public class Courier extends Person{
private String courierId;
// getter & setter
// Constructor 构造方法
public String getCourierId() {
return courierId;
}
public void setCourierId(String courierId) {
this.courierId = courierId;
}
// toString
@Override
public String toString() {
return "Courier{" +
"courierId='" + courierId + '\'' +
'}';
}
}