promotion.java

来自「一个简单的网上订书系统 java的课程设计」· Java 代码 · 共 62 行

JAVA
62
字号
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 + =
减小字号Ctrl + -
显示快捷键?