该程序实现显示最近的浏览记录,当点击书名链接时可查看关于该书的详细信息,返回后可在最近的浏览列表中查看浏览记录,最后点击的出现在最前面。
1.创建基本类Book存储基本数据
1: package net.csing;
2:3: public class Book {4: public Book(){}
5:6: public Book(String id,String name, String auth, String price, String publish,
7: String description) {8: super();
9: this.id=id;
10: this.name = name;
11: this.auth = auth;
12: this.price = price;
13: this.publish = publish;
14: this.description = description;
15: }16: private String id;
17: private String name;
18: private String auth;
19: private String price;
20: private String publish;
21: private String description;
22:23: public String getId() {
24: return id;
25: }26:27: public void setId(String id) {28: this.id = id;
29: }30: public String getName() {
31: return name;
32: }33: public void setName(String name) {34: this.name = name;
35: }36: public String getAuth() {
37: return auth;
38: }39: public void setAuth(String auth) {40: this.auth = auth;
41: }42: public String getPrice() {
43: return price;
44: }45: public void setPrice(String price) {46: this.price = price;
47: }48: public String getPublish() {
49: return publish;
50: }51: public void setPublish(String publish) {