📄 bookimpl.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -