详细步骤概述
步骤一:创建类Tushuxitong
package edu.tuhsu;
public class Tushuxitong {
// 名字 状态 借出日期 次数
public String name; //图书名称
public int state; //图书状态 0已借出1可借
public String date; //借出日期
public double number; // 库存
/*
图书信息展示
*/
public void dayin(int index) {
System.out.println(index + "\t\t\t\t" + name + "\t\t\t\t" + state + "\t\t\t\t" + date + "\t\t\t\t" + number);
}
public void setBook(String mingzi, int zhuangtai, String riqi, double kucun) {
this.name = mingzi;
this.state = zhuangtai;
this.date = riqi;
this.number = kucun;
}
}
步骤二:创建类Tushuxitong2
package edu.tuhsu;
public class Tushuxitong2 {
Tushuxitong[] books = new Tushuxitong[50];
}
步骤三:创建类Tushuxitong3
Tushuxitong03中含有initial、startMenu。
package edu.tuhsu;
import java.util.Scanner;
public class Tushuxitong3 {
Tushuxitong2 bookSet = new Tushuxitong2();
/**
* 初始化
*/
public void initial() {
Tushuxitong java = new Tushuxitong();
java.setBook("《java基础》", 1, "1990/2/3", 20);
Tushuxitong renyue = new Tushuxitong();
renyue.setBook("《软件技术》", 1, null, 0);
Tushuxiton