package com.demo.bean; public class Book {//教材 private long id; private String bookId;//教材ID private String name;//教材名称 private String price;//价格 private String author;//编者 private String publisher;//出版社 private String profession;//专业 private String channel;//渠道 private String appendix;//备注 public Book() {} public Book(long id, String bookId, String name, String price, String author, String publisher, String profession, String channel, String appendix) { this.id = id; this.bookId = bookId; this.name = name; this.price = price; this.author = author; this.publisher = publisher; this.profession = profession; this.channel = channel; this.appendix = appendix; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getBookId() { return bookId; } public void setBookId(String bookId) { this.bookId = bookId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public String getPublisher() { return publisher; } public void setPublisher(String publisher) { this.publisher = publisher; } public String getProfession() { return profession; } public void setProfession(String profession) { this.profession = profession; } public String getChannel() { return channel; } public void setChannel(String channel) { this.channel = channel; } public String getAppendix() { return appendix; } public void setAppendix(String appendix) { this.appendix = appendix; } @Override public String toString() { return "Book [id=" + id + ", bookId=" + bookId + ", name=" + name + ", price=" + price + ", author=" + author + ",
时间: 2024-04-06 16:29:13 浏览: 152
基于javaweb上机报告.doc
publisher=" + publisher + ", profession=" + profession + ", channel=" + channel + ", appendix=" + appendix + "]"; } }
这是一个 Java 类,表示一个教材(Book)对象,包括教材的 ID、名称、价格、编者、出版社、专业、渠道和备注等属性。其中包含了一个无参构造函数和一个有参构造函数,以及对应的 getter 和 setter 方法。此外,还重写了 toString 方法,以便于在需要打印该对象时,可以直接输出其属性值。
阅读全文