bookimpl.java

来自「dao模式结合mvc,dbcp连接池 log4j日志」· Java 代码 · 共 93 行

JAVA
93
字号
package com.bookstore.data;public class BookImpl implements Book{		private int id;		private String title;	private String type;	private double price;	private String notes;		public BookImpl()	{}		public BookImpl(String title, 				String type, double price, String notes)	{		this.title = title;		this.type = type;		this.price = price;		this.notes = notes;	}		public BookImpl(int id, String title, String type, double price, String notes)	{		this.id = id;		this.title = title;		this.type = type;		this.price = price;		this.notes = notes;	}		public String getNotes() {		return notes;	}	public void setNotes(String notes) {		this.notes = notes;	}	public double getPrice() {		return price;	}	public void setPrice(double price) {		this.price = price;	}	public String getTitle() {		return title;	}	public void setTitle(String title) {		this.title = title;	}	public String getType() {		return type;	}	public void setType(String type) {		this.type = type;	}		public int getId() {		return id;	}	public void setId(int id) {		this.id = id;	}		public String toString()    {        StringBuffer sbResult = new StringBuffer();        sbResult.append("id = ");        sbResult.append(id);        sbResult.append(", 书名 = ");        sbResult.append(title);        sbResult.append(", 价格 = ");        sbResult.append(price);        sbResult.append(", 类型 = ");        sbResult.append(type);        sbResult.append(", 备注 = ");        sbResult.append(notes);                return sbResult.toString();    }}

⌨️ 快捷键说明

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