私人雙周假期;
代碼二:
public void setWeeklySalary(Double weeklySalary){
this . weekly salary = weekly salary;
}
代碼三:
私人雙薪;
私有整數塊;
公共計件工(字符串名,整數p,雙s) {
超級(名);
設定薪金;
設定件(p);
}
public void setPiece(整數p){
this . piece = p;
}
public void setSalary(Double s){
this . salary = s;
}
公共雙倍收入(){
退貨件*工資;
}
代碼四:
私人雙薪;
私人整數小時;
公共計件工(字符串名,整數h,雙s) {
超級(名);
設定薪金;
setHour(h);
}
公共void setHour(整數h){
this . hour = h;
}
public void setSalary(Double s){
this . salary = s;
}
公共雙倍收入(){
返回h *工資;
}