```
//第一
package tushuguananli;
import java.text.SimpleDateFormat;
import java.util.Date;
public class TuShu {
// 状态 名称 借出时间
public String state;
public String name;
public Date date;
public void setTuShu(String zhuangtai , String mingzi, Date riqi){
state=zhuangtai;
name=mingzi;
date=riqi;
}
public void print( int index){
System.out.println(index+"\t"+name+"\t"+state+"\t"+date);
}
}
//第二
package tushuguananli;
public class TuShuSet {
TuShu[] tushus=new TuShu[30];
}
//第三
package tushuguananli;
import sun.util.calendar.BaseCalendar;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
public class TuShuManage {
TuShuSet tushuset=new TuShuSet();
//仓库初始化 放入商品
public void initila(){
TuShu tushu1=new TuShu();
tushu1.setTuShu( "已借出" ,"<<java基础教程>>", new Date());
TuShu tushu2=new TuShu();
tushu2.setTuShu("可借", "<<数据库技术>>", null);
TuShu tushu3=new TuShu();
tushu3.setTuShu("可借", "<<人与神话>>" ,null);
tushuset.tushus[0]=tushu1;
tushuset.tushus[1]=tushu2;
tushuset.tushus[2]=tushu3;
}
//菜单
public void startMenu() throws ParseException {
System.out.println("欢迎使用图书管理系统");
System.out.println("————————————————————————————");
boolean flag=true;
do{
System.out.println("1.新增图书");
System.out.println("2.查看图书");
System.out.println("3.删除图书");
System.out.println("4.借出图书");
System.out.println("5.归还图书");
System.out.println("6.退出");
System.out.println("请选择:");
Scanner scanner=new Scanner(System.in);
int num=scanner.nextInt();
switch (num){
case 1:
System.out.println("--->新增图书");
xinzeng();
break;
case 2:
System.out.println("--->查看图书");
chakan();
break;
```