⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 product.java

📁 ssd3 java程序练习 exercise 3 绝对没有问题
💻 JAVA
字号:
import com.sun.org.apache.bcel.internal.generic.NEW;


public class Product {
	private String code;
	private String description;
	private double price;
	
	public Product() {
		// TODO Auto-generated constructor stub
	}
	
	public Product(String initialCode,
            String initialDescription,
            double initialPrice){
		this.code = initialCode;
		this.description = initialDescription;
		this.price = initialPrice;
	}
	
	public String getCode(){
		return this.code;
	}
	
	public String getDescription(){
		return this.description;
	}
	
	public double getPrice(){
		return this.price;
	}
	
	public boolean equals(Product object){
		return (this.code == object.getCode());
	}
	
	public String toString (){
		return this.getCode()+"_"+this.getDescription()
		+"_"+this.getPrice();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -