product.java
来自「网上商城源代码!实现了书店的列表和增加」· Java 代码 · 共 51 行
JAVA
51 行
package bookstore.model.eneity;import java.io.Serializable;public class Product implements Serializable{ private int id; private String name; private String description; private double price; public Product(){} public Product(String name,String description,double price){ this.name=name; this.description=description; this.price=price; } public void setId(int id) { this.id = id; } public Integer getId(){ return this.id; } public void setName(String name){ this.name=name; } public String getName(){ return this.name; } public void setDescription(String d){ this.description=d; } public String getDescription(){ return this.description; } public void setPrice(double p){ this.price=p; } public double getPrice(){ return this.price; } public boolean equals(Object obj){ if(!(obj instanceof Product)) return false; Product p=(Product) obj; return p.getName().equals(name)||p.getId().equals(id); } public int hashCode(){ return name.hashCode()^id; } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?