java-items
2024-10-07 16:08:15
类名Items
package entity; //商品类
public class Items { private int id; // 商品编号
private String name; // 商品名称
private String city; // 产地
private int price; // 价格
private int number; // 库存
private String picture; // 商品图片 //保留此不带参数的构造方法
public Items()
{ } public Items(int id,String name,String city,int price,int number,String picture)
{
this.id = id;
this.name = name;
this.city = city;
this.picture = picture;
this.price = price;
this.number = number; }
public int getId() {
return id;
} public void setId(int id) {
this.id = id;
} public String getName() {
return name;
} public void setName(String name) {
this.name = name;
} public String getCity() {
return city;
} public void setCity(String city) {
this.city = city;
} public int getPrice() {
return price;
} public void setPrice(int price) {
this.price = price;
} public int getNumber() {
return number;
} public void setNumber(int number) {
this.number = number;
} public String getPicture() {
return picture;
} public void setPicture(String picture) {
this.picture = picture;
} @Override
public int hashCode() {
// TODO Auto-generated method stub
return this.getId()+this.getName().hashCode();
} @Override
public boolean equals(Object obj) {
// TODO Auto-generated method stub
if(this==obj)
{
return true;
}
if(obj instanceof Items)
{
Items i = (Items)obj;
if(this.getId()==i.getId()&&this.getName().equals(i.getName()))
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
} public String toString()
{
return "商品编号:"+this.getId()+",商品名称:"+this.getName();
} }
最新文章
- Spring MVC 处理静态资源文件
- GitHub 上 57 款最流行的开源深度学习项目
- javascript 函数重载 overloading
- django模板里循环变量<;table>;里想要两个一行如何控制
- 【原创】NIO框架入门(二):服务端基于MINA2的UDP双向通信Demo演示
- <;textarea>;输入框提示文字
- 树莓派(Raspberry Pi)修改时区
- [Angular2 Form] Use RxJS Streams with Angular 2 Forms
- ios状态栏调整 简单动画的知识点
- MFC的消息机制
- [Cocos2d-x]节点的尺寸大小
- .Net Core 第三方工具包整理
- Python自学笔记-递归函数(来自廖雪峰的官网Python3)
- DataBase MongoDB高级知识-易使用
- 3-51单片机WIFI学习(开发板8266底层源码介绍)
- odoo开发笔记 -- 模型字段定义中设置默认值
- linux umask使用方法
- redis-set
- 增加wamp64 PHP支持版本
- Linux tar 解压 压缩(转)
热门文章
- BZOJ 1006: [HNOI2008]神奇的国度(弦图)
- 微信公众号ios10.1 版本白屏问题
- 用JOptionPane类实现各种对话框
- LINUXE下执行php 定时任务
- jackson反序列化报错Unrecognized field , not marked as ignorable
- Java短路运算符和非短路运算符
- intellij免费激活码
- 【lua学习笔记】——Notepad++ 设置运行 lua 和 python
- STL中六大组件
- Eureka 系列(03)Spring Cloud 自动装配原理