📄 promotion.java
字号:
package beans;
import java.sql.Date;
public class Promotion {
private String Pno;
private double discount;
private Date duration;
public Promotion() {
Pno = null;
discount = 0.0;
duration = null;
}
public Promotion(String[] args) {
if (args.length != 3)
return;
Pno = args[0];
discount = Double.parseDouble(args[1]);
duration = Date.valueOf(args[2]);
}
public Promotion(String Pno, double discount, String duration) {
this.Pno = Pno;
this.discount = discount;
this.duration = Date.valueOf(duration);
}
public String getPno() {
return Pno;
}
public void setPno(String Pno) {
this.Pno = Pno;
}
public double getDiscount() {
return discount;
}
public void setDiscount(double discount) {
this.discount = discount;
}
public Date getDuration() {
return duration;
}
public void setDuration(String duration) {
this.duration = Date.valueOf(duration);
}
public String toString() {
return getPno() + " " + getDiscount() + " " + getDuration();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -