该系统总共有以下这么多个部分

一、book文件夹下:
- Book中有每一本书得信息,与这些信息的Get和Set方法,还有对于书的toString方法
package 一月十八日.图书管理系统.book;
public class Book {
private String name;
private String author;
private int price;
private String type;
private boolean status;
public Book(String name, String author, int price, String type) {
this.name = name;
this.author = author;
this.price = price;
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public boolean isStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
@Override
public String toString() {
return "book{" +
"name='" + name + '\'' +
", author='" + author + '\'' +
", price=" + price +
", type='" + type + '\'' +
((status == true) ? " 借出 " : " 未借出 ") +
'}';
}
}
- BookList这里相当于一个书架,其实是由顺序表的形式实现的
package 一月十八日.图书管理系统.book;
public class BookList {
private Book[] books;
private int usedSize;
public BookList() {
this.books = new Book[10];
books[0] = new Book("三国演义","罗贯中",72,"小说");
books[1] = new Book("西游记","吴承恩",52,"小说");
books[2] = new Book("水浒传","施耐庵",62,"小说");
this.usedSize = 3;
}
public void setBooks(int pos, Book book){
this.books[pos] = book;
}
public Book getBook(int pos){
return this.books[pos];
}
public int getUsedSize() {
return usedSize;
}
public void setUsedSize(int usedSize) {
this.usedSize = usedSize;
}
}
二、Operation文件夹下: