Java圖書管理系統(tǒng)課程設(shè)計(jì)
本文實(shí)例為大家分享了Java圖書管理系統(tǒng)的具體代碼,供大家參考,具體內(nèi)容如下
大二上學(xué)期做的一個(gè)Java課程設(shè)計(jì),總分為四個(gè)Java文件,AllBook,AllBorrow,AllStudent,Tushu。
本系統(tǒng)是一個(gè)面向圖書館的管理系統(tǒng),具有一定的實(shí)用性。它主要完成了圖書的基本操作功能,全校學(xué)生信息的相關(guān)基本操作,以及對圖書的借閱歸還管理。本系統(tǒng)采用當(dāng)前流行的面向?qū)ο蟮腏AVA語言開發(fā)工具eclipse來完成整個(gè)系統(tǒng)的設(shè)計(jì)。系統(tǒng)在設(shè)計(jì)過程中不可避免地遇到了各種各樣的問題,由于整個(gè)系統(tǒng)完全都是由個(gè)人設(shè)計(jì)的,有關(guān)eclipse許多細(xì)節(jié)問題都要靠自己去摸索,加之本人水平有限,有很多的方面還不夠完善,數(shù)據(jù)不能永久保留。希望在學(xué)習(xí)更多的知識之后能將系統(tǒng)做的更加完善,更加實(shí)用。
文件位置
AllBook
package tushuguan; import java.io.Serializable; import java.util.Scanner; //------------------------圖書信息的代碼-------------------------- @SuppressWarnings("serial") class Book implements Serializable{ //圖書類 ?? ??? ?String BookNo; ? ? ? ? ? ? ?//編號 ?? ??? ?String BookName; ? ? ? ? ? ?//書名 ?? ??? ?String BookAuthor; ? ? ? ? ?//作者 ?? ??? ?int zk; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//是否在庫 ?? ??? ?int cs; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//借閱次數(shù) ?? ??? ?showInfo info=new showInfo(); ? ? ? ?//借閱信息日常顯示 ? ? public Book(){ ? ? ? ? ? ? ? ? ? ? ? ? ? //定義構(gòu)造方法,初始化數(shù)據(jù)項(xiàng) ?? ??? ??? ?BookNo=""; ?? ??? ??? ?BookName=""; ?? ??? ??? ?BookAuthor=""; ?? ? ?? ??? ??? ?zk=0; ?? ??? ??? ?cs=0; ?? ??? ??? ?} ?? ??? ?public String getBookNo(){ ?? ??? ??? ?return BookNo; ?? ??? ?} ?? ??? ?public String getBookName(){ ?? ??? ??? ?return BookName; ?? ??? ?} ?? ??? ?public String getBookAuthor(){ ?? ??? ??? ?return BookAuthor; ?? ??? ?} ? ?? ? ?? ?//````````````````````````新增圖書信息`````````````````````````` ?? ?public void inputBook(){ ? ? ? ? ? ? ? ? //輸入單個(gè)圖書 ?? ??? ?@SuppressWarnings({"resource" }) ?? ??? ?Scanner in2=new Scanner(System.in); ? ?? ??? ?System.out.print("請輸入圖書編號:"); ?? ??? ?String s; ?? ??? ?s=in2.nextLine(); ?? ? ? ?int a; ?? ??? ?a=AllBook.queryBooByBookNo(s); ?? ??? ?while(a!=-1){ ? ? ? ? ? ? ? ? ? ? ? ? ? ?//判斷是否已有相同編號的圖書存在 ?? ??? ?System.out.print("該書籍已存在,請重新輸入!\n"); ?? ? ? ?System.out.print("請輸入圖書編號:"); ?? ? ? ?s=in2.nextLine(); ?? ? ? ?a=AllBook.queryBooByBookNo(s); ?? ??? ?} ?? ??? ?BookNo=s; ? ? ? ? System.out.print("請輸入圖書名稱:"); ?? ? ? ?BookName=in2.nextLine(); ? ? ??? ?System.out.print("請輸入圖書作者:"); ? ? ?? ?BookAuthor=in2.nextLine(); ? ? ? ? zk=1; ?? ??? ?} ??? ??? ? ? ? public void showBook(){ ? ? ? ? ? ? ? ? ? ? ? ?//顯示單個(gè)圖書信息 ?? ?System.out.print("圖書編號:"+BookNo+"\n圖書名稱:"+BookName+"\n圖書作者:"+BookAuthor+"\n借閱次數(shù):"+cs); ?? ??? ??? ?if(zk==1) ?? ??? ??? ??? ?System.out.print("\n該圖書:在庫\n"); ?? ??? ??? ?else ?? ??? ??? ??? ?System.out.print("\n該圖書: 不在庫\n"); ?? ??? ? ? }?? ??? ? ?? ? ? ?} ? ?? ? ? ? @SuppressWarnings("serial") public class AllBook ?implements Serializable{ ? ? ?//所有圖書集合類? ?? ? ? ?static Book []Book=new Book[20]; ? ? ? //定義一個(gè)能存儲20個(gè)圖書的數(shù)組對象 ?? ??? ?static int index=0; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//用于存儲當(dāng)前已有圖書的數(shù)量 ?? ?public ?AllBook(){ ? ? ? ? ? ? ? ? ? ? //初始化所有單元的圖書信息; ?? ??? ?for(int i=0;i<Book.length;i++){ ?? ??? ??? ?Book[i]=new Book(); ?? ??? ??? ?} ?? ?} ?? ?//---------------輸入多個(gè)圖書信息-------------------- ?? ?public void inputAB(){ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? int a=1; ?? ??? ?for(int i=index;i<Book.length;i++){ ?? ??? ??? ?if(a==1){ ?? ??? ??? ? System.out.print("下面錄入第"+(index+1)+"本圖書的信息:\n"); ?? ??? ??? ?Book[index].inputBook(); ?? ??? ??? ? index++; ?? ??? ??? ? System.out.print("繼續(xù)添加請按1,停止添加請按0:"); ? ??? ??? ??? ? int b; ? ??? ??? ??? ? @SuppressWarnings("resource") ?? ??? ??? ? Scanner in1=new Scanner(System.in); ? ??? ??? ??? ? b=in1.nextInt(); ? ??? ??? ??? ?switch(b){ ? ??? ??? ??? ?case 0: a=0;break; ? ??? ??? ??? ?default: break; ? ??? ??? ??? ? ? ? ? ? } ?? ??? ? ? ? ? ??? ?} ?? ??? ? } ??? ??? ??? ? ? ?? ?} ??? ? ?? ?//`````````````````````````瀏覽多個(gè)圖書信息```````````````````````` ?? ?public void showAllBook(){//顯示所有圖書信息 ?? ??? ?System.out.print("共有"+index+"本書"); ?? ??? ??? ?for(int i=0;i<index;i++){ ?? ??? ??? ??? ?System.out.print("\n下面輸出第"+(i+1)+"本書的信息:\n"); ?? ??? ??? ?Book[i].showBook(); ? ?? ??? ??? ? ?? ??? ??? ?} ?? ??? ??? ?if(index==0){ ?? ??? ??? ??? ?System.out.print("沒有圖書信息!"); ?? ??? ??? ?} ?? ??? ?} ?? ?//************************************** ?? ?public void queryByBookNo(){ ? ? ? ? ? ? ? ? //1.按編號查詢 ?? ??? ??? ?String a; ?? ??? ??? ?@SuppressWarnings("resource") ?? ??? ? ? ?Scanner in2=new Scanner(System.in); ?? ??? ??? ?System.out.print("請輸入要查詢的圖書編號:"); ?? ??? ??? ?a=in2.nextLine(); ?? ??? ??? ?if(queryBooByBookNo(a)!=-1){ ?? ??? ??? ?System.out.print("該圖書信息為:\n"); ?? ??? ??? ?Book[queryBooByBookNo(a)].showBook(); ?? ??? ??? ?} ?? ??? ??? ?else ?? ??? ??? ??? ? ?? ??? ??? ??? ?System.out.print("該圖書不存在!");?? ? ?? ? ? ?? ??? ?} ?? ?public static int queryBooByBookNo(String s){//按編號查詢,s為查詢的圖書編號;若找到,則返回該信息的位置,否則返回-1 ?? ??? ??? ?int flag=-1; ?? ??? ??? ?for(int i=0;i<index;i++){ ?? ??? ??? ??? ?if(s.equals(Book[i].BookNo)){ ?? ??? ??? ??? ??? ?flag=i;break; ?? ??? ??? ??? ?} ?? ??? ??? ?} ?? ?return flag; ?? ??? ?} ? ? //****************************************?? ??? ? ?? ?public void queryByBookName(){ ? ? ? ? ? ? ? //2.按名稱查詢 ?? ??? ??? ?String a; ?? ??? ??? ?@SuppressWarnings("resource") ?? ??? ? ? ?Scanner in1=new Scanner(System.in); ?? ??? ??? ?System.out.print("請輸入要查詢的圖書名稱:"); ?? ??? ??? ?a=in1.nextLine(); ?? ??? ??? ?if(queryBooByBookName(a)!=-1){ ?? ??? ??? ?System.out.print("該圖書信息為:\n"); ?? ??? ??? ?Book[queryBooByBookName(a)].showBook(); ?? ??? ??? ?} ?? ??? ??? ?else ?? ??? ??? ??? ? ?? ??? ??? ??? ?System.out.print("該圖書不存在!");?? ? ? ?? ??? ??? ? ?? ? ? ?? ??? ?} ?? ?public int queryBooByBookName(String s){ ? ? ?//按名稱查詢,s為查詢的圖書名稱;若找到,則返回該信息的位置,否則返回-1 ?? ??? ??? ?int flag=-1; ?? ??? ??? ?for(int i=0;i<index;i++){ ?? ??? ??? ??? ?if(s.equals(Book[i].BookName)){ ?? ??? ??? ??? ??? ?flag=i;break; ?? ??? ??? ??? ?} ?? ??? ??? ?} ?? ??? ??? ?return flag; ?? ??? ?} ?? ?//************************************* ?? ?public void queryByBookAuthor(){ ? ? ? ? ? ? ? ? //3.按作者查詢 ?? ??? ??? ?String a; ?? ??? ??? ?@SuppressWarnings("resource") ?? ??? ?Scanner in1=new Scanner(System.in); ?? ??? ??? ?System.out.print("請輸入要查詢的圖書作者:"); ?? ??? ??? ?a=in1.nextLine(); ?? ??? ??? ?if(queryBooByBookAuthor(a)!=-1){ ?? ??? ??? ? System.out.print("該圖書信息為:\n"); ?? ??? ??? ?Book[queryBooByBookAuthor(a)].showBook(); ?? ??? ??? ?} ?? ??? ??? ?else?? ??? ??? ??? ? ?? ??? ??? ??? ?System.out.print("該圖書不存在!");?? ? ?? ??? ??? ? ?? ? ? ?? ??? ?} ?? ?public int queryBooByBookAuthor(String s){ ? ? ?//按作者查詢,s為查詢的圖書作者;若找到,則返回該信息的位置,否則返回-1 ?? ??? ??? ?int flag=-1; ?? ??? ??? ?for(int i=0;i<index;i++){ ?? ??? ??? ??? ?if(s.equalsIgnoreCase(Book[i].BookAuthor)){ ?? ??? ??? ??? ??? ?flag=i;break; ?? ??? ??? ??? ?} ?? ??? ??? ?} ?? ??? ??? ?return flag; ?? ??? ?}?? ??? ? ? ? //```````````````````````刪除圖書信息`````````````````````````` ?? ?public void deleteByBookNo(){ ? ? ? ? ? ? ? ? ?//刪除指定編號的圖書信息 ? ?String b; ? ?@SuppressWarnings("resource") ? ?Scanner in2=new Scanner(System.in); ? ?System.out.print("請輸入要?jiǎng)h除圖書的編號"); ? ?b=in2.nextLine(); ? ? if (queryBooByBookNo(b)!=-1){ ? ? ? ? ? ? ? ? ? ?//判斷該圖書是否存在 ?? ??? ??? ??? ? ?for(int i=queryBooByBookNo(b);i<index-1;i++){ ?? ??? ??? ??? ? ?Book[i]=Book[i+1];?? ??? ? ?? ??? ??? ??? ? ?}? ?? ??? ??? ??? ? ?System.out.print("刪除成功!"); ?? ??? ??? ??? ? ?index--; ?? ??? ??? ??? ? ?} ? ? else ? ? ?? ?System.out.print("該圖書不存在!");?? ? ?? ? ? } ?? ?//```````````````````````修改圖書信息`````````````````````````` ?? ? ? ?@SuppressWarnings("resource") ?? ?public void reviseByBookNo(){ ? ? ? ? ? ? ? ? ?// 按編號查找該圖書并修改圖書內(nèi)容 ?? ??? ?String b; ?? ??? ?int n; ?? ?Scanner in2=new Scanner(System.in); ?? ?Scanner in3=new Scanner(System.in); ? ? System.out.print("請輸入要修改的圖書編號"); ? ? b=in3.nextLine(); ? ?? ??? ??? ??? ? ? ? ?if(queryBooByBookNo(b)!=-1){?? ??? ? //判斷該圖書是否存在 ?? ??? ??? ??? ??? ? ? ?int i=queryBooByBookNo(b); ?? ??? ??? ? ? ? ? ? ? ?System.out.println("請選擇要修改的圖書信息:"); ?? ??? ??? ??? ??? ??? ?System.out.println("1-修改圖書編號"); ?? ??? ??? ??? ??? ??? ?System.out.println("2-修改圖書名稱"); ?? ??? ??? ??? ??? ??? ?System.out.println("3-修改圖書作者"); ?? ??? ??? ??? ??? ??? ?System.out.println("4-修改所有信息"); ?? ??? ??? ??? ??? ??? ? n=in2.nextInt(); ?? ??? ??? ??? ??? ??? ? while(n<0||n>4){ ?? ??? ??? ??? ??? ??? ??? ??? ?System.out.print("該數(shù)字無效,請重新選擇:"); ?? ??? ??? ??? ??? ??? ??? ??? ?n=in2.nextInt();} ?? ??? ??? ??? ?switch(n){ ?? ??? ??? ??? ?case 1:{?? ??? ??? ??? ??? ??? ??? ? ?? ??? ??? ??? ??? ? ? ? System.out.println("請輸入修改后的圖書編號:"); ?? ??? ??? ??? ??? ? ? ? Book[i].BookNo=in3.nextLine();?? ?break; ?? ??? ??? ??? ??? ??? ? } ?? ??? ??? ??? ?case 2:{ ?? ??? ??? ??? ??? ??? ?System.out.println("請輸入修改后的圖書名稱:"); ?? ??? ??? ??? ??? ??? ?Book[i].BookName=in3.nextLine();break; ?? ??? ??? ??? ??? ??? ? } ?? ??? ??? ? ? ?case 3:{ ?? ??? ??? ? ? ??? ? ? System.out.println("請輸入修改后的圖書作者:"); ?? ??? ??? ??? ??? ? ? Book[i].BookAuthor=in3.nextLine();break; ?? ??? ??? ??? ??? ? ? ? } ?? ??? ??? ? ? ?case 4:{ ?? ??? ??? ? ? ??? ? ? System.out.println("請輸入修改后的圖書編號、圖書名稱 、圖書作者:"); ?? ??? ??? ? ? ??? ? ? System.out.println("請輸入修改后的圖書編號:"); ?? ??? ??? ? ? ??? ? ? Book[i].BookNo=in3.nextLine(); ?? ??? ??? ? ? ??? ? ? System.out.println("請輸入修改后的圖書名稱:"); ?? ??? ??? ? ? ??? ? ? Book[i].BookName=in3.nextLine(); ?? ??? ??? ? ? ??? ? ? System.out.println("請輸入修改后的圖書作者:"); ?? ??? ??? ? ? ??? ? ? Book[i].BookAuthor=in3.nextLine(); ?? ??? ??? ? ? ?} ?? ??? ??? ??? ??? ??? ? } System.out.print("修改成功!");?? ? ? ?? ??? ??? ??? ?} ?? ??? ??? ??? ? ? ?else ?? ??? ??? ??? ??? ?System.out.print("該圖書不存在!"); ?? ??? ??? ??? ?}?? ? ??? ??? ??? ? ? ?? ?? ??? ?} ?
AllBorrow
package tushuguan; import java.io.Serializable; import java.util.Scanner; class showInfo { ? ? ? ? ? ? ? ? //定義一個(gè)借閱信息顯示類 ? ?? ? String lendtime; ? ? ? ? ? ?//借書日期 ? ?? ? String returntime; ? ? ? ? ?//還書日期 ? ?? ? String lendStuNo; ? ? ? ? ? //借書學(xué)生編號 ? ?? ? String lendStuName; ? ? ? ? //借書學(xué)生姓名 ? ?? ? String lendStuClass; ? ? ? ?//借書學(xué)生班級 ? ?? ? public showInfo(){ ? ? ? ? ?//定義構(gòu)造方法,初始化數(shù)據(jù)項(xiàng)?? ? ? ?? ??? ? lendtime=""; ? ? ? ? ? ? ? ? ? ?? ? ? ? returntime=""; ? ?? ? ? ? lendStuNo=""; ? ?? ? ? ? lendStuName=""; ? ?? ? ? ? lendStuClass=""; ? ?? ? } } @SuppressWarnings("serial") class Borrow implements Serializable{//借閱類 ?? ? static int BoCs; ? ? ? ? ? ? ? ?//最大的借閱次數(shù) ?? ? String StudentNo; ?? ? String BookNo; ?? ?public Borrow(){ ? ? ? ? ?//定義構(gòu)造方法,初始化數(shù)據(jù)項(xiàng)?? ??? ??? ? ?? ??? ??? ? BoCs=0; ?? ??? ??? ? StudentNo=""; ?? ??? ??? ? BookNo=""; ?? ??? ??? ?} } @SuppressWarnings("serial") class AllBorrow ?implements Serializable{//所有借閱類 ?? ??? ? ?? ?//-----------------顯示借閱信息---------------?? ?? ? ? public void showlendInfo(String BookNo){ ?? ? ?? ? int a=AllBook.queryBooByBookNo(BookNo); ? ? ?//找到該編號對應(yīng)的圖書下標(biāo)賦值給a ?? ? ?? ? System.out.print("\n該圖書的借閱信息為:");?? ? ?? ? ?? ? ?? ? System.out.print("\n該借書學(xué)生學(xué)號為:"+AllBook.Book[a].info.lendStuNo); ?? ? ?? ? System.out.print("\n該借書學(xué)生姓名為:"+AllBook.Book[a].info.lendStuName); ?? ? ?? ? System.out.print("\n該借書學(xué)生班級為:"+AllBook.Book[a].info.lendStuClass); ?? ? ?? ? System.out.print("\n該圖書的借出日期:"+AllBook.Book[a].info.lendtime); ?? ? ?? ? ?? ? } ?? ?//---------------顯示歸還信息------------------ ?? ?public void showlendReturn(String BookNo){ ?? ? ?? ? int a=AllBook.queryBooByBookNo(BookNo); ? ? ?//找到該編號對應(yīng)的圖書下標(biāo)賦值給a ?? ? ?? ? System.out.print("\n該圖書的歸還信息為:");?? ? ?? ? ?? ? ?? ? System.out.print("\n該借書學(xué)生學(xué)號為:"+AllBook.Book[a].info.lendStuNo); ?? ? ?? ? System.out.print("\n該借書學(xué)生姓名為:"+AllBook.Book[a].info.lendStuName); ?? ? ?? ? System.out.print("\n該借書學(xué)生班級為:"+AllBook.Book[a].info.lendStuClass); ?? ? ?? ? System.out.print("\n該圖書的借出日期:"+AllBook.Book[a].info.lendtime); ?? ? ?? ? System.out.print("\n該圖書的歸還日期:"+AllBook.Book[a].info.returntime); ?? ? } ?? ?//----------------------多本圖書借閱----------------?? ? ?? ?@SuppressWarnings("resource") ?? ?public void Alllend(){ ?? ??? ? Scanner in1=new ?Scanner(System.in); ?? ??? ? Scanner in2=new Scanner(System.in); ?? ??? ? int a=0,b=0; ?? ??? ? String StudentNo,BookNo,d; ?? ??? ? int c=1; ?? ??? ? System.out.print("請輸入你的學(xué)號:"); ?? ??? ? ? ?StudentNo=in1.nextLine();?? ??? ? ? ?? ??? ??? ?b=AllStudent.queryStuByStudentNo(StudentNo); ?? ??? ??? ?if(b!=-1){ ? ? ? ? ? ? ? ? //判斷該學(xué)生是否存在 ?? ??? ??? ? ? ? ? ? ? System.out.print("登錄成功!\n"); ?? ??? ??? ? ? ? ? ? ? while(c==1){ ?? ??? ??? ? ?? ??? ? ? ?System.out.print("請查詢要借閱的圖書\n");?? ? ? ? ? ? ?? ??? ??? ? ?? ? ? ? ? ?System.out.print("請輸入該書編號:");?? ? ? ? ?? ??? ??? ? ?? ? ? ? ? ?BookNo=in1.nextLine(); ?? ??? ??? ? ?? ? ? ? ? ?a=AllBook.queryBooByBookNo(BookNo); ?? ??? ??? ? ?? ? ? ? ? ?if(a!=-1){ ? //判斷圖書是否存在 ?? ??? ??? ? ?? ? ? ? ? ? if(AllBook.Book[a].zk==1){?? ? ? ?//判斷圖書是否在庫 ? ?? ?? ??? ??? ? ?? ? ? ? ? ? AllBook.Book[a].showBook();?? ? ?? ??? ??? ? ?? ? ? ? ? ? System.out.print("\n該圖書在庫,請?zhí)顚懡栝喰畔ⅲ?); ?? ??? ??? ? ?? ? ? ? ? ? AllBook.Book[a].zk=0; ? ? ?//借出圖書,將圖書的在庫信息修改為不在庫 ?? ??? ??? ? ?? ? ? ? ? ? AllBook.Book[a].cs++; ? ? ?//借出圖書,該圖書借閱次數(shù)加一 ?? ??? ??? ? ?? ? ? ??? ? AllBook.Book[a].info.lendStuNo=AllStudent.Student[b].StudentNo; ?? ??? ??? ??? ? ? ? ?? ? AllBook.Book[a].info.lendStuName=AllStudent.Student[b].StudentName; ?? ??? ??? ??? ? ? ? ?? ? AllBook.Book[a].info.lendStuClass=AllStudent.Student[b].StudentClass; ?? ??? ??? ? ?? ? ? ? ? ? System.out.print("\n請?zhí)顚懡璩鋈掌?xxxxxxxx):"); ?? ??? ??? ? ?? ? ? ? ? ? d=in1.nextLine(); ?? ??? ??? ? ?? ? ? ? ? ? while(d.length()!=8){ ? ? //判斷日期格式是否正確 ?? ??? ??? ? ?? ? ? ? ? ??? ? System.out.print("日期格式錯(cuò)誤,請重新輸入8個(gè)字符的借書日期(如20180101)"); ?? ??? ??? ? ?? ? ? ? ? ??? ? System.out.print("\n請重新填寫歸還日期:"); ?? ??? ??? ? ?? ? ? ? ? ??? ? d=in1.nextLine(); ?? ??? ??? ? ?? ??? ? ? } ?? ??? ??? ? ?? ? ? ? ? ?AllBook.Book[a].info.lendtime=d; ?? ??? ??? ? ?? ? ? ? ? ?System.out.print("借閱成功!"); ?? ??? ??? ? ?? ? ? ? ? ? ?? ??? ??? ? ?? ??? ??? ? } ?? ??? ??? ? ?? ? ? ? ? ? else ?? ??? ??? ? ?? ? ? ??? ? ? ?System.out.print("圖書不在庫,借閱失敗!"); ?? ??? ??? ? ?? ? ? ? ? ?} ?? ??? ??? ? ?? ? ? ? ? ?else ?? ??? ??? ? ?? ? ? ? ? ??? ? System.out.print("圖書不存在,借閱失敗!"); ?? ??? ??? ? ? ? ? ??? ??? ??? ? ? ? ? ?? ??? ??? ? ? ? ? ?System.out.print("\n是否繼續(xù)借閱:1-是,0-否");?? ??? ? ? ?? ??? ??? ? ? ? ? ?c=in2.nextInt(); ?? ??? ??? ? ? ? ? ?switch(c){ ?? ? ? ?? ??? ? ? ? ?? ?case 0: c=0;break; ?? ? ? ?? ??? ? ? ??? ?default: break; ?? ? ? ?? ??? ??? ? ? ? ? ? ? ?} ?? ??? ??? ? ? ? } ?? ??? ??? ?} ?? ??? ??? ?else ?? ??? ??? ? ?System.out.print("該學(xué)生信息不存在!\n");?? ? ? ?? ??? ??? ?}?? ?? ?? ?//---------------歸還圖書管理(單本)--------- ?? ?@SuppressWarnings("resource") ?? ?public void returnBook(){ ?? ??? ? Scanner in1=new Scanner(System.in); ?? ??? ? Scanner in2=new Scanner(System.in); ?? ??? ? System.out.print("請輸入歸還圖書的編號:"); ?? ??? ? String BookNo,b; ?? ??? ? BookNo=in1.nextLine(); ?? ??? ? int a=AllBook.queryBooByBookNo(BookNo); ?? ??? ? if(a!=-1){ ?? ??? ? ?if(AllBook.Book[a].zk==0){?? ??? ??? ? ?? ??? ??? ? ?System.out.print("\n請?zhí)顚憵w還日期(xxxxxxxx):"); ?? ??? ??? ? b=in2.nextLine(); ?? ??? ??? ?if(b.length()!=8){ ? //判斷日期格式 ?? ??? ??? ? while (b.length()!=8){?? ??? ? ?? ??? ??? ??? ? ?System.out.print("歸還日期出錯(cuò)!");? ?? ??? ??? ??? ? ?System.out.print("\n請重新填寫歸還日期,例如20180101:"); ?? ??? ??? ??? ? ?AllBook.Book[a].info.returntime=in2.nextLine(); ?? ??? ? ? ?}}?? ??? ? ?? ??? ? ? ?else ?? ??? ??? ? ?while(AllBook.Book[a].info.returntime.compareTo(AllBook.Book[a].info.lendtime)<=0){ ?? ??? ??? ? ?System.out.print("歸還時(shí)間不對,請輸入不小于借閱日期的日期"); ?? ??? ??? ? ?System.out.print("\n請重新填寫歸還日期:"); ?? ??? ??? ? ?AllBook.Book[a].info.returntime=in2.nextLine(); ?? ??? ??? ?} ?? ??? ??? ?AllBook.Book[a].zk=1; ?? ??? ??? ? ?System.out.print("歸還成功!");? ?? ??? ??? ? ?showlendReturn(BookNo);} ?? ??? ? ?else ?? ??? ??? ? ?System.out.print("該圖書在庫不需要?dú)w還!"); ?? ??? ? } ?? ??? ? else ?? ??? ??? ? System.out.print("不存在該圖書!");?? ??? ?? ?? ? }?? ? ? ? ?? ?//--------------------多本圖書歸還------------------- ? ? @SuppressWarnings("resource") ?? ?public void Allreturn(){ ?? ? int c=1; ?? ? Scanner in1=new ?Scanner(System.in);?? ?? ?? ? while(c==1){ ?? ??? ? ? ?returnBook();? ?? ? ? ? ? ?System.out.print("\n\n是否繼續(xù)歸還:1-是,0-否");?? ??? ? ? ?? ? ? ? ? ?c=in1.nextInt(); ?? ? ? ? ? ?switch(c){ ?? ? ? ? ?? ?case 0: c=0;break; ?? ? ? ? ?? ?case 1: break; ?? ? ? ??? ?default: break; ?? ??? ? ? ? ? ? ? ?} ? ? ? ? ?? ? }?? ?? ? ? ?} ? ?? ? ? //----------------按借閱次數(shù)查詢------------------- ? ? public int ?findBoCs(){ ?//找到最大的借閱次數(shù) ?? ? for(int i=0;i<AllBook.index;i++){ ?? ??? ? if(Borrow.BoCs<AllBook.Book[i].cs){ ?? ??? ??? ? Borrow.BoCs=AllBook.Book[i].cs; ?? ??? ? }?? ??? ?? ?? ? }return Borrow.BoCs; } ? ? public void findByTj(){ ? //按借閱次數(shù)查詢 ?? ? int a= findBoCs(); ?? ? int c=0; ?? ?System.out.print("最大借閱次數(shù)為"+a+",請輸入要查詢的借閱次數(shù):"); ?? ?@SuppressWarnings("resource") ?? ?Scanner in1=new Scanner(System.in); ?? ?int b; ?? ?b=in1.nextInt();?? ? ?? ?if(b<=a){ ?? ? ? ? System.out.print("\n借閱次數(shù)為"+b+"的圖書信息如下:\n"); ?? ? ? ? for(int ?i=0;i<AllBook.index;i++){ ?? ??? ? ?if(AllBook.Book[i].cs==b){ ?? ??? ??? ?AllBook.Book[i].showBook(); ?? ??? ??? ? c++; ?? ??? ? ? ? } ?? ? ? ? ?} ?? ??? ? ? if(c==0){ ?? ??? ??? ? ?System.out.print("\n不存在借閱次數(shù)為"+b+"的圖書"); ?? ??? ? ? ? } ?? ? ? ? ?} ?? ?else ?? ?System.out.print("該借閱次數(shù)超過最大借閱次數(shù)!"); } ?? ? ?? ?//-------------------顯示所有在庫圖書---------------- ?? ?public void showzkBook(){ ?? ??? ?int c=0; ?? ??? ?System.out.print("所有在庫的圖書信息為:\n"); ?? ??? ?for(int ?i=0;i<AllBook.index;i++){ ?? ??? ??? ?if(AllBook.Book[i].zk==1){ ?? ??? ??? ??? ?AllBook.Book[i].showBook(); ?? ??? ??? ??? ?c++; ?? ??? ??? ?} ?? ??? ?} ?? ??? ?if(c==0){ ?? ??? ??? ?System.out.print("無在庫圖書!"); ?? ??? ?} ?? ?} ?? ?//-------------------顯示所有不在庫圖書---------------- ?? ?public void showbzkBook(){ ?? ??? ?int c=0; ?? ??? ?System.out.print("所有不在庫的圖書信息為:\n"); ?? ??? ?for(int ?i=0;i<AllBook.index;i++){ ?? ??? ??? ?if(AllBook.Book[i].zk==0){ ?? ??? ??? ??? ?AllBook.Book[i].showBook(); ?? ??? ??? ??? ?c++; ?? ??? ??? ?} ?? ??? ?} ?? ??? ?if(c==0){ ?? ??? ?System.out.print("無不在庫圖書!"); ?? ??? ?} ?? ?} ? ? ? //----------------------圖書查詢管理---------------------- ? ? public void findbook(){ ?? ? @SuppressWarnings("resource") ?? ?Scanner in=new Scanner(System.in); ?? ? String b; ?? ? System.out.print("請輸入要查找圖書的編號:\n"); ?? ? b=in.nextLine(); ?? ? int a=AllBook.queryBooByBookNo(b); ? ? if(a!=-1){ ? ? ? if(AllBook.Book[a].zk==1)?? ? ? ? ? ?? ? ? ? ? ? AllBook.Book[a].showBook();?? ? ? ? ? else ? ??? ? ? { ? ??? ? ? AllBook.Book[a].showBook(); ? ??? ? ? showlendInfo(b); ? } ? ?? ? ? } ? ? else ? ? ?? ? System.out.print("圖書不存在!");?? ?? } }
AllStudent
package tushuguan; import java.io.Serializable; import java.util.Scanner; ?? ?@SuppressWarnings("serial") class Student implements Serializable{ //學(xué)生類 ? ??? ??? ?String StudentNo; ? ?//學(xué)號 ? ??? ??? ?String StudentName; ?//書名 ? ??? ??? ?String StudentClass; //班級 ? ??? ??? ? ? ?? ? ? public Student(){//定義構(gòu)造方法,初始化數(shù)據(jù)項(xiàng) ? ??? ??? ??? ?StudentNo=""; ? ??? ??? ??? ?StudentName=""; ? ??? ??? ??? ?StudentClass=""; ?? ??? ? ? ??? ??? ??? ?} ? ??? ? ? ?public String getStudentNo(){ ? ??? ??? ??? ?return StudentNo; ? ??? ??? ?} ? ??? ? ? ?public String getStudentName(){ ? ??? ??? ??? ?return StudentName; ? ??? ??? ?} ? ??? ? ? ?public String getStudentClass(){ ? ??? ??? ??? ?return StudentClass; ? ??? ??? ?} ??? ??? ? ? ??? ??? ?//````````````````````````新增學(xué)生信息`````````````````````````` ? ??? ?public void inputStudent(){//輸入單個(gè)學(xué)生 ? ??? ??? ??? ?@SuppressWarnings("resource") ?? ??? ??? ?Scanner in2=new Scanner(System.in); ? ??? ??? ??? ?System.out.print("請輸入學(xué)生學(xué)號:"); ? ??? ??? ??? ?String s; ? ??? ??? ??? ?s=in2.nextLine(); ? ??? ??? ??? ?int a; ?? ??? ??? ?a=AllStudent.queryStuByStudentNo(s); ?? ??? ??? ?while(a!=-1){ ? ? ? ? //判斷是否已經(jīng)存在該學(xué)號的學(xué)生 ?? ??? ??? ? System.out.print("該學(xué)生已存在,請重新輸入!\n"); ?? ??? ? ? ? System.out.print("請輸入學(xué)生學(xué)號:"); ?? ??? ? ? ? s=in2.nextLine(); ?? ??? ? ? ? a=AllStudent.queryStuByStudentNo(s); ?? ??? ??? ?} ?? ??? ??? ?StudentNo=s; ? ??? ??? ??? ?System.out.print("請輸入學(xué)生名稱:"); ? ??? ??? ??? ?StudentName=in2.nextLine(); ? ??? ??? ??? ?System.out.print("請輸入學(xué)生班級:"); ? ??? ??? ??? ?StudentClass=in2.nextLine(); ??? ??? ??? ? ? ??? ??? ?} ?? ?public void showStudent(){//顯示單個(gè)學(xué)生信息 ? ??? ??? ??? ?System.out.print("學(xué)生學(xué)號:"+StudentNo+"\n學(xué)生名稱:"+StudentName+"\n學(xué)生班級:"+StudentClass); ? ??? ? ? ??? ??? ?}?? ??? ? ? ??? ?} ? ?? ? ?? ?@SuppressWarnings("serial") public class AllStudent implements Serializable{ ? ? ? ? ? ? ? ? ? ? ?//所有學(xué)生集合類? ? ??? ? ? ?static Student []Student=new Student[20]; ? ? ? ? ? ? ? ? ? ? //定義一個(gè)能存儲20個(gè)學(xué)生的數(shù)組對象 ? ??? ??? ?static int index=0; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//用于存儲當(dāng)前已有學(xué)生的數(shù)量 ? ??? ??? ?public ?AllStudent(){ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//初始化所有單元的學(xué)生信息; ? ??? ??? ? for(int i=0;i<Student.length;i++){ ? ??? ??? ??? ?Student[i]=new Student(); ? ??? ??? ??? ?} ? ??? ??? ?} ? ??? ?//----------------輸入多個(gè)學(xué)生信息--------------- ? ??? ?public void inputAS(){ ? ? ? ? ? ? int a=1; ? ??? ??? ? ? ?for(int i=index;i<Student.length;i++){ ? ??? ??? ??? ?if(a==1){ ? ??? ??? ??? ? ? System.out.print("下面錄入第"+(index+1)+"個(gè)學(xué)生的信息:\n"); ? ? ?? ??? ??? ?Student[i].inputStudent(); ? ? ?? ??? ??? ?index++; ? ? ?? ??? ??? ?System.out.print("繼續(xù)添加請按1,停止添加請按0:"); ? ? ? ??? ??? ??? ?int b; ? ? ? ??? ??? ??? ?@SuppressWarnings("resource") ?? ??? ??? ??? ?Scanner in1=new Scanner(System.in); ? ? ? ??? ??? ??? ?b=in1.nextInt(); ? ? ? ??? ??? ??? ?switch(b){ ? ? ? ??? ??? ??? ?case 0: a=0;break; ? ? ? ??? ??? ??? ?default: break; ? ? ? ??? ??? ??? ? ? ? ? ? ? ?} ? ??? ??? ? ? ? ? ??? ?} ? ??? ??? ? } ?? ??? ??? ? ? ? ??? ?}?? ? ? ??? ?//`````````````````````````瀏覽學(xué)生信息```````````````````````` ? ??? ?public void showAllStudent(){//顯示所有學(xué)生信息 ? ??? ??? ??? ?for(int i=0;i<index;i++){ ? ??? ??? ??? ??? ?System.out.print("\n下面輸出第"+(i+1)+"個(gè)學(xué)生的信息:\n"); ? ? ?? ??? ??? ?Student[i].showStudent(); ?? ??? ??? ? ? ? ?? ??? ??? ?} ? ??? ??? ??? ?if(index==0){ ? ??? ??? ??? ??? ?System.out.print("沒有學(xué)生信息!"); ? ??? ??? ??? ?} ? ??? ??? ?}? ? ??? ??? ?@SuppressWarnings("resource") ?? ?public void queryByStudentNo(){ ? ? ? ? ? ? ? ? //1.按學(xué)號查詢 ? ??? ??? ??? ?String a; ? ??? ??? ??? ?int c; ? ??? ??? ??? ?Scanner in1=new Scanner(System.in); ? ??? ??? ??? ?System.out.print("請輸入要查詢的學(xué)生編號:"); ? ??? ??? ??? ?a=in1.nextLine(); ? ??? ??? ??? ?c=queryStuByStudentNo(a); ? ??? ??? ??? ?if(c!=-1){ ? ??? ??? ??? ? System.out.print("該學(xué)生信息為:\n"); ?? ??? ??? ? Student[queryStuByStudentNo(a)].showStudent(); ? ??? ??? ??? ?} ? ??? ??? ??? ?else ??? ??? ??? ??? ? ? ??? ??? ??? ??? ?System.out.print("該學(xué)生不存在!");?? ??? ??? ??? ? ? ??? ? ? ?? ??? ?} ? ??? ?public static int queryStuByStudentNo(String s){//按學(xué)號查詢,s為查詢的學(xué)生學(xué)號;若找到,則返回該信息的位置,否則返回-1 ? ??? ??? ??? ?int flag=-1; ? ??? ??? ??? ?for(int i=0;i<index;i++){ ? ??? ??? ??? ??? ?if(s.equalsIgnoreCase(Student[i].StudentNo)){ ? ??? ??? ??? ??? ??? ?flag=i;break; ? ??? ??? ??? ??? ?} ? ??? ??? ??? ?} ? ??? ??? ??? ?return flag; ? ??? ??? ?} ? ? //******************************************* ? ??? ??? ?@SuppressWarnings("resource") ?? ?public void queryByStudentName(){ ? ? ? ? ? ? ? ? //2.按名字查詢 ? ??? ??? ??? ?String a; ? ??? ??? ??? ?Scanner in1=new Scanner(System.in); ? ??? ??? ??? ?System.out.print("請輸入要查詢的學(xué)生名字:"); ? ??? ??? ??? ?a=in1.nextLine(); ? ??? ??? ??? ?if(queryStuByStudentName(a)!=-1){ ? ??? ??? ??? ? System.out.print("該學(xué)生信息為:\n"); ?? ??? ??? ? ?Student[queryStuByStudentName(a)].showStudent(); ? ??? ??? ??? ?} ? ??? ??? ??? ?else?? ??? ??? ? ? ??? ??? ??? ??? ?System.out.print("該學(xué)生不存在!");?? ? ? ??? ??? ??? ? ? ??? ? ? ?? ??? ?} ? ??? ?public int queryStuByStudentName(String s){ ? ? ? //按名字查詢,s為查詢的學(xué)生名字;若找到,則返回該信息的位置,否則返回-1 ? ??? ??? ??? ?int flag=-1; ? ??? ??? ??? ?for(int i=0;i<index;i++){ ? ??? ??? ??? ??? ?if(s.equalsIgnoreCase(Student[i].StudentName)){ ? ??? ??? ??? ??? ??? ?flag=i;break; ? ??? ??? ??? ??? ?} ? ??? ??? ??? ??? ?else ? ??? ??? ??? ??? ??? ?continue; ? ??? ??? ??? ?} ? ??? ??? ??? ?return flag; ? ??? ??? ?} ? ??? ?//******************************************* ? ??? ??? ?@SuppressWarnings("resource") ?? ?public void queryByStudentClass(){ ? ? ? ? ? ? ? ? //3.按班級查詢 ? ??? ??? ??? ?String a; ? ??? ??? ??? ?Scanner in1=new Scanner(System.in); ? ??? ??? ??? ?System.out.print("請輸入要查詢的學(xué)生班級:"); ? ??? ??? ??? ?a=in1.nextLine(); ? ??? ??? ??? ?if(queryStuByStudentClass(a)!=-1){ ? ??? ??? ??? ? System.out.print("該學(xué)生信息為:\n"); ?? ??? ??? ? ?Student[queryStuByStudentClass(a)].showStudent(); ? ??? ??? ??? ?} ? ??? ??? ??? ?else ?? ??? ??? ??? ? ? ??? ??? ??? ??? ?System.out.print("該學(xué)生不存在!");?? ? ? ?? ??? ??? ? ? ??? ? ? ?? ??? ?} ? ??? ?public int queryStuByStudentClass(String s){ ? ? ? ? //按班級查詢,s為查詢的學(xué)生班級;若找到,則返回該信息的位置,否則返回-1 ? ??? ??? ??? ?int flag=-1; ? ??? ??? ??? ?for(int i=0;i<index;i++){ ? ??? ??? ??? ??? ?if(s.equalsIgnoreCase(Student[i].StudentClass)){ ? ??? ??? ??? ??? ??? ?flag=i;break; ? ??? ??? ??? ??? ?} ? ??? ??? ??? ??? ?else ? ??? ??? ??? ??? ??? ?continue; ? ??? ??? ??? ?} ? ??? ??? ??? ?return flag; ? ??? ??? ?} ?? ??? ? ? ??? ?//```````````````````````刪除學(xué)生信息`````````````````````````` ? ??? ? @SuppressWarnings("resource") ?? ?public void deleteByStudentNo(){ ? ? ? ? ? ? ? ? ?//刪除指定學(xué)號的學(xué)生信息 ? ? ? ? ?String b; ? ? ? ? ?Scanner in2=new Scanner(System.in); ? ? ? ? ?System.out.print("請輸入要?jiǎng)h除學(xué)生的學(xué)號"); ? ? ? ? ?b=in2.nextLine(); ? ? ? ? ? if (queryStuByStudentNo(b)!=-1){ ? ?? ??? ??? ??? ??? ? ?for(int i=queryStuByStudentNo(b);i<index;i++){ ? ?? ??? ??? ??? ??? ? ?Student[i]=Student[i+1]; ? ?? ??? ??? ??? ??? ? ??? ??? ??? ??? ??? ? ?} ? ?? ??? ??? ??? ??? ? ? ?index--; ? ? ?? ??? ??? ??? ??? ?System.out.print("刪除成功!"); ? ?? ??? ??? ??? ??? ? ?} ? ? ? ? ? else ? ? ? ? ? ?? ?System.out.print("該學(xué)生不存在!");?? ? ? ? ??? ? ? } ??? ? ? ??? ?//```````````````````````修改學(xué)生信息`````````````````````````` ? ? ?@SuppressWarnings("resource") ?? ?public void reviseByStudentNo(){ ? ? ? ? ?// 按編號查找該圖書并修改圖書內(nèi)容 ? ? ?? ??? ?String b; ? ? ?? ??? ?int n; ? ? ? ? ?Scanner in2=new Scanner(System.in); ? ? ? ? ?Scanner in3=new Scanner(System.in); ? ? ? ? ?System.out.print("請輸入要修改的學(xué)生編號:"); ? ? ? ? ?b=in2.nextLine(); ? ? ? ? ?? ??? ??? ??? ? ? ? ?if(queryStuByStudentNo(b)!=-1){?? ??? ? ? ?? ??? ??? ??? ??? ? ? ?int i=queryStuByStudentNo(b); ? ?? ??? ??? ? ? ? ? ? ? ?System.out.println("請選擇要修改的學(xué)生信息:"); ? ?? ??? ??? ??? ??? ??? ?System.out.println("1-修改學(xué)生學(xué)號"); ? ?? ??? ??? ??? ??? ??? ?System.out.println("2-修改學(xué)生姓名"); ? ?? ??? ??? ??? ??? ??? ?System.out.println("3-修改學(xué)生班級"); ? ?? ??? ??? ??? ??? ??? ?System.out.println("4-修改所有信息"); ? ?? ??? ??? ??? ??? ??? ? n=in2.nextInt(); ? ?? ??? ??? ??? ??? ??? ?while(n<0||n>4){ ? ?? ??? ??? ??? ??? ??? ??? ?System.out.print("該數(shù)字無效,請重新選擇:"); ? ?? ??? ??? ??? ??? ??? ??? ?n=in2.nextInt();} ? ?? ??? ??? ??? ??? ??? ? switch(n){ ? ?? ??? ??? ??? ?case 1:{ ??? ??? ??? ??? ??? ??? ??? ? ? ?? ??? ??? ??? ??? ? ? ?System.out.println("請輸入修改后的學(xué)生學(xué)號:"); ? ?? ??? ??? ??? ??? ??? ?Student[i].StudentNo=in3.nextLine();?? ?break; ? ?? ??? ??? ??? ??? ??? ? } ? ?? ??? ??? ??? ?case 2:{ ? ?? ??? ??? ??? ??? ??? ?System.out.println("請輸入修改后的學(xué)生姓名:"); ? ?? ??? ??? ??? ??? ??? ?Student[i].StudentName=in3.nextLine();break; ? ?? ??? ??? ??? ??? ??? ? } ? ?? ??? ??? ? ? ?case 3:{ ? ?? ??? ??? ? ? ??? ? ? ?System.out.println("請輸入修改后的學(xué)生班級:"); ? ?? ??? ??? ? ? ??? ? ? ?Student[i].StudentClass=in3.nextLine();break; ? ?? ??? ??? ??? ??? ??? ??? ?} ? ?? ??? ??? ? ? ?case 4:{ ? ?? ??? ??? ? ? ??? ? ? ?System.out.println("請輸入修改后的學(xué)生學(xué)號、姓名、班級:"); ? ?? ??? ??? ? ? ??? ? ? ?System.out.println("請輸入修改后的學(xué)生學(xué)號:"); ? ?? ??? ??? ? ? ??? ? ? ?Student[i].StudentNo=in3.nextLine(); ? ?? ??? ??? ? ? ??? ? ? ?System.out.println("請輸入修改后的學(xué)生姓名:"); ?? ??? ??? ??? ??? ??? ?Student[i].StudentName=in3.nextLine(); ?? ??? ??? ??? ??? ??? ?System.out.println("請輸入修改后的學(xué)生班級:"); ? ?? ??? ??? ? ? ??? ? ? ?Student[i].StudentClass=in3.nextLine(); ? ?? ??? ??? ? ? ?} ? ?? ??? ??? ??? ??? ??? ? } System.out.print("修改成功!");?? ? ? ? ?? ??? ??? ??? ?} ? ?? ??? ??? ??? ? ? ?else ? ?? ??? ??? ??? ??? ?System.out.print("該學(xué)生不存在!"); ? ?? ??? ??? ??? ?}?? ? ? ?? ??? ??? ? ? ??? ?? ? ? }
Tushu
package tushuguan; import java.io.Serializable; import java.util.Scanner;?? ? ?? ?@SuppressWarnings("unused") class Menu{//菜單類 ?? ??? ?AllBook Book=new AllBook(); ?? ??? ?AllStudent Student=new AllStudent(); ?? ??? ?AllBorrow Borrow= new AllBorrow();? ?? ??? ? ?? ? ? ?public void showMenu(){//主菜單部分 ?? ? ? ?? ??? ?System.out.println("******系部圖書成績管理系統(tǒng)*******"); ?? ? ? ?? ??? ?System.out.println("** ? ? 1.圖書信息管理 ? ? ? ? ? ? ? ? ? **"); ?? ? ? ?? ??? ?System.out.println("** ? ? 2.學(xué)生信息管理 ? ? ? ? ? ? ? ? ? **"); ?? ? ? ?? ??? ?System.out.println("** ? ? 3.借閱信息管理 ? ? ? ? ? ? ? ? ? **"); ?? ? ? ?? ??? ?System.out.println("** ? ? 0.退出總管理系統(tǒng) ? ? ? ? ? ? ? ?**"); ?? ? ? ?? ??? ?System.out.println("***************************"); ?? ? ? ?? ??? ?System.out.println("請選擇: "); ?? ? ? ?? ??? ?selectMenu(); ?? ? ? ?? ?} ?? ? ? ?? ?public void selectMenu(){//選擇主菜單部分 ?? ? ? ?? ??? ?@SuppressWarnings("resource") ?? ??? ??? ?Scanner in1=new Scanner(System.in); ?? ? ? ?? ??? ?int a; ?? ? ? ?? ??? ?a=in1.nextInt(); ?? ? ? ?? ??? ?while(a<0||a>3){ ?? ? ? ?? ??? ??? ?System.out.print("該數(shù)字無效,請重新選擇:"); ?? ? ? ?? ??? ??? ?a=in1.nextInt(); ?? ? ? ?? ??? ?} ?? ? ? ?? ??? ?switch (a){ ?? ? ? ?? ??? ?case 1:{showMBook();break;} ?? ? ? ?? ??? ?case 2:{showMStudent();break;} ?? ? ? ?? ??? ?case 3:{showMBorrow();break;} ?? ? ? ? ?? ?case 0:{System.out.print("******感謝您的使用!******");} ?? ? ? ?? ??? ?} ?? ? ? ?? ?} ?? ? ?? ? ?//-------------------------圖書信息管理目錄-----------------------------? ?? ? ? ?? ?public void showMBook(){//圖書信息管理目錄 ?? ? ?? ? ? ?? ??? ?System.out.println("\n*******圖書信息管理目錄******"); ?? ? ? ?? ??? ?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("** ? ? ? 0.退出總管理系統(tǒng) ? ? ? ? ?**"); ?? ? ? ?? ??? ?System.out.println("************************************"); ?? ? ? ?? ??? ?System.out.println("請選擇:"); ?? ? ? ?? ??? ?selectMBook(); ?? ? ? ?? ?} ?? ? ? ?? ?public void selectMBook(){//選擇圖書目錄 ?? ? ? ?? ??? ?@SuppressWarnings("resource") ?? ??? ??? ?Scanner in1=new Scanner(System.in); ?? ? ? ?? ??? ?int b; ?? ? ? ?? ??? ?b=in1.nextInt(); ?? ? ? ?? ??? ?while(b>6||b<0){ ?? ? ? ?? ??? ??? ?System.out.print("該數(shù)字無效,請重新選擇:"); ?? ? ? ?? ??? ??? ?b=in1.nextInt(); ?? ? ? ?? ??? ?} ?? ? ? ?? ??? ?switch (b){ ?? ? ? ?? ??? ?case 1:{ ?? ? ? ?? ??? ? ? ? ? ? ? ? ? ? ? ?Book.inputAB(); ? ? ? ? ? ? ? ? ?//新增圖書信息 ?? ? ? ?? ??? ? ? ? ? ? ? ? ? ? ? ?System.out.print("\n完成圖書信息新增操作.\n"); ?? ? ? ?? ??? ? ? ? ? ? ? ? ? ? ? ?showMBook();break;} ?? ? ? ?? ??? ?case 2:{ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ?? ??? ? ? ? ? ? ? ? ? ? ?? ?? ??? ??? ??? ??? ??? ??? ??? ?findBook(); ? ? ? ? ? ? ? ? //查找圖書信息 ?? ? ? ?? ??? ? ? ? ? ? ? ? ? ? ? ?System.out.print("\n完成圖書信息查詢操作.\n"); ?? ? ? ?? ??? ? ? ? ? ? ? ? ? ? ? ?showMBook();break;} ?? ? ? ?? ? ?? ? ? ?? ??? ?case 3:{ ? ?? ??? ??? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ?? ??? ??? ? ? ? ? ? ? ? ? Book.deleteByBookNo(); ? ? ? ? ? //刪除圖書信息 ?? ? ? ?? ??? ??? ? ? ? ? ? ? ? ? System.out.print("\n完成圖書信息刪除操作.\n"); ?? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? showMBook();break;} ?? ? ? ?? ??? ?case 4:{ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ?? ??? ? ? ? ? ? ? ? ? ? ? Book.showAllBook(); ? ? ? ? ? ? ?//瀏覽圖書信息 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ?? ? ? ?? ??? ? ? ? ? ? ? ? ? ? ? System.out.print("\n完成圖書信息瀏覽操作.\n"); ?? ? ? ?? ??? ? ? ? ? ? ? ? ? ? ? showMBook();break;} ?? ? ? ?? ??? ?case 5:{ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ?? ? ? ?? ??? ??? ? ? ? ? ? ? ? ? Book.reviseByBookNo(); ? ? ? ?//修改圖書信息 ?? ? ? ?? ??? ? ? ? ? ? ? ? ? ? ? System.out.print("\n完成圖書信息修改操作.\n"); ?? ? ? ?? ??? ??? ? ? ? ? ? ? ? ? showMBook();break;} ?? ? ? ?? ??? ?case 6:{ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ?? ??? ??? ? ? ? ? ? ? ? ? showMenu();} ? ? ? ? ? ? ? ? ? ? ? ? //返回上一界面 ?? ? ? ?? ??? ? ?? ? ? ?? ??? ?case 0:{ ? ? ? ? ? System.out.print("\n******感謝您的使用!******");System.exit(0);} ??? ? ?? ? ? ?? ?} ? ?? ? ?? ? ? } ?? ? ?//`````````````````````````查詢圖書信息```````````````````````` ?? ??? ?public void findBook(){ ?? ? ? ? ? ? ? System.out.print("\n請選擇查找圖書方式:\n"); ?? ? ? ? ? ? ? System.out.println("*******查找圖書方式******"); ?? ? ? ? ? ? ? System.out.println("** ? ? ? 1.按圖書編號查找 ? ? ? ? ? ? ? ? **"); ?? ? ? ? ? ? ? System.out.println("** ? ? ? 2.按圖書名稱查找 ? ? ? ? ? ? ? ? **"); ?? ? ? ? ? ? ? System.out.println("** ? ? ? 3.按圖書作者查找 ? ? ? ? ? ? ? ? **"); ?? ? ? ? ? ? ? System.out.println("** ? ? ? 0.返回上一菜單 ? ? ? ? ? ? ? ? ? ? **"); ?? ? ? ? ? ? ? @SuppressWarnings("resource") ?? ??? ??? ? ?Scanner in2=new Scanner(System.in); ?? ? ? ? ? ? ??? ? ? ? int c; ?? ? ? ? ? ? ? ? ? ? ?c=in2.nextInt(); ?? ? ? ? ? ? ? ? ? ? ?while(c<0||c>3){ ?? ? ? ? ? ? ? ? ?? ??? ??? ?System.out.print("該數(shù)字無效,請重新選擇:"); ?? ? ? ? ? ? ? ? ?? ??? ??? ?c=in2.nextInt();} ?? ? ? ? ? ? ? ? ? ? ?switch(c){ ?? ? ? ? ? ? ? ? ? ? ?case 1:{ ?? ? ? ? ? ? ? ? ? ? ? ? ?Book.queryByBookNo();break; ? ? ? ?//按編號查詢圖書信息 ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? } ?? ? ? ? ? ? ? ? ? ? ?case 2:{ ?? ? ? ? ? ? ? ? ? ? ? ? ?Book.queryByBookName(); break; ? ? //按書名查詢圖書信息 ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?} ?? ? ? ? ? ? ? ? ? ? ?case 3:{ ?? ? ? ? ? ? ? ? ? ? ? ? ?Book.queryByBookAuthor(); break; ? //按作者查詢圖書信息 ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? } ?? ? ? ? ? ? ? ? ? ? ?case 0:{ ?? ?? ? ? ? ? ? ? ? ? ??? ? ? ? showMBook();}} ?? ??? ??? ?} ?? ? ?//-------------------------學(xué)生信息管理目錄----------------------------- ?? ? ? ?public void showMStudent(){//學(xué)生信息管理目錄 ? ?? ? ? ??? ??? ?System.out.println("\n*******學(xué)生信息管理目錄******"); ? ??? ??? ?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("** ? ? ? 0.退出總管理系統(tǒng) ? ? ? **"); ? ??? ??? ?System.out.println("*************************"); ? ??? ??? ?System.out.println("請選擇:"); ? ??? ??? ?selectMStudent(); ? ??? ?} ? ? ??? ?public void selectMStudent(){//選擇學(xué)生目錄 ? ??? ??? ?@SuppressWarnings("resource") ?? ??? ?Scanner in1=new Scanner(System.in); ? ??? ??? ?int b; ? ??? ??? ?b=in1.nextInt(); ?? ? ? ??? ??? ?while(b<0||b>6){ ? ??? ??? ??? ?System.out.print("該數(shù)字無效,請重新選擇:"); ? ??? ??? ??? ?b=in1.nextInt(); ? ??? ??? ?} ? ??? ??? ?switch (b){ ? ??? ??? ?case 1:{ ? ??? ??? ? ? ? ? ? ? ? ? ? ?Student.inputAS(); ? ? ? ? ? ? ? //新增學(xué)生信息 ? ??? ??? ? ? ? ? ? ? ? ? ? ?System.out.print("\n完成學(xué)生信息新增操作\n"); ? ??? ??? ? ? ? ? ? ? ? ? ? ?showMStudent();break;} ? ??? ??? ?case 2:{ ? ??? ??? ??? ? ? ? ? ? ? ? ?findStudent(); ? ? ? ? ? //查找學(xué)生信息 ? ??? ??? ? ? ? ? ? ? ? ? ? ?System.out.print("\n完成學(xué)生信息查詢操作\n"); ? ??? ??? ? ? ? ? ? ? ? ? ? ?showMStudent();break;} ? ??? ? ? ??? ??? ?case 3:{ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ??? ??? ??? ? ? ? ? ? ? ? ?Student.deleteByStudentNo();?? ? ? //刪除學(xué)生信息 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??? ? ? ?? ? ? ? ? ??? ??? ? ? ? ? ? ? ? ? ? ?System.out.print("\n完成學(xué)生信息刪除操作\n"); ? ??? ? ? ? ? ? ? ? ? ? ? ? ?showMStudent();break;} ? ??? ??? ?case 4:{ ? ??? ??? ? ? ? ? ? ? ? ? ? ?Student.showAllStudent(); ? ? //瀏覽學(xué)生信息 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ??? ??? ? ? ? ? ? ? ? ? ? ?System.out.print("\n完成學(xué)生信息瀏覽操作\n"); ? ??? ??? ? ? ? ? ? ? ? ? ? ?showMStudent();break;} ? ??? ??? ?case 5:{ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??? ??? ??? ? ? ? ? ? ? ? ?Student.reviseByStudentNo();//修改圖書信息 ? ??? ??? ? ? ? ? ? ? ? ? ? ?System.out.print("\n完成學(xué)生信息修改操作\n"); ?? ? ? ? ? ? ? ? ? ? ? ? ?showMStudent();break;} ? ??? ??? ?case 6:{ ? ??? ??? ??? ? ? ? ? ? ? ? ?showMenu(); ? ?} ? ? ? ? ? ? ? ? ? ? ?//返回主菜單 ? ??? ??? ? ? ??? ??? ?case 0:{ ? ? ? ? ?System.out.print("\n******感謝您的使用!******");System.exit(0);} ? ??? ? ? ??? ?} ??? ? ? ?} ? ? ?? ?//`````````````````````````查詢學(xué)生信息```````````````````````` ? ??? ??? ?@SuppressWarnings("resource") ?? ?public void findStudent(){ ? ??? ??? ??? ? ? System.out.print("\n請選擇查找學(xué)生方式:\n"); ? ? ? ? ? ? ? ?System.out.println("***********查找學(xué)生方式**********"); ? ? ? ? ?? ? ? System.out.println("** ? ? ? 1.按學(xué)生學(xué)號查找 ? ? ? ? ? ? ? ? **"); ? ? ? ? ? ? ? ?System.out.println("** ? ? ? 2.按學(xué)生名稱查找 ? ? ? ? ? ? ? ? **"); ? ? ? ? ? ? ? ?System.out.println("** ? ? ? 3.按學(xué)生班級查找 ? ? ? ? ? ? ? ? **"); ? ? ? ? ? ? ? ?System.out.println("** ? ? ? 0.返回上一菜單 ? ? ? ? ? ? ? ? ? ? ?**"); ? ? ? ? ? ? ? ?Scanner in2=new Scanner(System.in); ? ? ? ? ? ? ? ?int c; ? ? ? ? ? ? ? ?c=in2.nextInt(); ? ? ? ? ? ? ? ?while(c<0||c>3){ ? ? ? ??? ??? ??? ?System.out.print("該數(shù)字無效,請重新選擇:"); ? ? ? ??? ??? ??? ?c=in2.nextInt();} ? ? ? switch(c){ ? ? ? ? ? ? ? ? ? case 1:{ ? ? ? ? ? ? ? ? ? ? ? ? Student.queryByStudentNo();break; ? ? ?//按學(xué)號查詢學(xué)生信息 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? } ? ? ? ? ? ? ? ? ? case 2:{ ? ? ? ? ? ? ? ? ? ? ? ? Student.queryByStudentName(); break; ? //按姓名查詢學(xué)生信息 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ? case 3:{ ? ? ? ? ? ? ? ? ? ? ? ?Student.queryByStudentClass(); break; ? //按班級查詢學(xué)生信息 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ? case 0:{ showMStudent();} ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ?? ? ??? ??? ?} ? ? ? //-------------------------圖書借閱信息管理目錄----------------------------- ? ? ? ? public void showMBorrow(){ ?? ? ? ?System.out.println("\n*******借閱圖書信息管理目錄*****"); ?? ??? ?System.out.println("** ? ? ? 1.圖書借閱管理 ? ? ? ? ? ? ? ?**"); ?? ??? ?System.out.println("** ? ? ? 2.圖書歸還管理 ? ? ? ? ? ? ? ?**");?? ??? ? ? ??? ??? ?System.out.println("** ? ? ? 3.圖書查詢管理 ? ? ? ? ? ? ? ?**"); ? ??? ??? ?System.out.println("** ? ? ? 4.統(tǒng)計(jì)查詢管理 ? ? ? ? ? ? ? ?**");?? ??? ? ? ??? ??? ?System.out.println("** ? ? ? 5.返回上一菜單 ? ? ? ? ? ? ? ?**"); ? ??? ??? ?System.out.println("** ? ? ? 0.退出總管理系統(tǒng) ? ? ? ? ? ? **"); ? ??? ??? ?System.out.println("**********************************"); ? ??? ??? ?System.out.println("請選擇:"); ? ??? ??? ?selectMBorrow(); ? ??? ?} ? ? ?? ?public void selectMBorrow(){//選擇圖書目錄 ? ??? ??? ?@SuppressWarnings("resource") ?? ??? ?Scanner in1=new Scanner(System.in); ? ??? ??? ?int b; ? ??? ??? ?b=in1.nextInt(); ? ??? ??? ?while(b<0||b>5){ ? ??? ??? ??? ?System.out.print("該數(shù)字無效,請重新選擇:"); ? ??? ??? ??? ?b=in1.nextInt();} ? ??? ??? ?switch(b){ ? ??? ??? ?case 1:{? ? ??? ??? ? ? ? ? ?Borrow.Alllend(); ? ? ? ? ?//圖書借閱管理 ? ??? ??? ? ? ? ? ?System.out.print("\n完成圖書借閱操作\n"); ? ? ? ? ? ? ? ? showMBorrow();break; ??? ??? ? ? ? ? ? ??? ??? ? ? ??? ??? ?} ? ??? ??? ?case 2:{ ? ??? ??? ? ? ? ? ?Borrow.Allreturn(); ? ? ? //圖書歸還管理 ?? ??? ? ? ? ? ?System.out.print("\n完成圖書借閱操作\n"); ? ? ? ? ? ? ? ? showMBorrow();break; ??? ? ? ??? ??? ?} ??? ??? ? ? ??? ??? ?case 3:{ ? ??? ??? ??? ? ? ?Borrow.findbook(); ? ? ? //圖書查詢管理 ? ??? ? ? ? ? ? ? ?System.out.print("\n完成圖書查詢操作\n"); ? ? ? ? ? ? ? ? showMBorrow();break; ? ? ??? ??? ?} ? ??? ??? ?case 4:{ ?? ??? ??? ? ? TjfindBook(); ? ? //統(tǒng)計(jì)查詢管理 ?? ??? ? ? ? ? System.out.print("\n完成圖書統(tǒng)計(jì)查詢操作\n"); ? ? ? ? ? ? ? ?showMBorrow();break; ??? ? ?? ??? ?} ? ??? ??? ?case 5:{ ? showMenu(); ? ? ?} ? ? //返回主菜單 ? ??? ??? ?case 0:{ ? System.out.print("\n******感謝您的使用!******");System.exit(0);} ??? ??? ? ? ??? ??? ?} ? ? ? ? } ?? ?//-------------------統(tǒng)計(jì)查詢管理-------------------------- ? ? public void TjfindBook(){ ?? ? System.out.println("請選擇統(tǒng)計(jì)查詢的方式:\n"); ?? ? System.out.println("1-按借閱次數(shù)查詢"); ?? ? System.out.println("2-按在庫與否查詢"); ?? ? System.out.println("0-返回上一菜單 ?"); ?? ? @SuppressWarnings("resource")?? ?? ?? ? Scanner in1 =new Scanner(System.in); ?? ? int a; ?? ? a=in1.nextInt(); ?? ? while(a<0||a>3){ ?? ??? ??? ?System.out.print("該數(shù)字無效,請重新選擇:"); ?? ??? ??? ?a=in1.nextInt();} ?? ? switch(a){ ?? ? case 1:{ ?? ??? ? ? ? ? ? ? Borrow.findByTj(); ? ? ?//按借閱次數(shù)查詢 ?? ? ? ? ? ? ? ? ? System.out.print("\n完成統(tǒng)計(jì)查詢圖書操作\n"); ?? ? ? ? ? ? ? ? ? showMBorrow();break; ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? } ?? ? case 2:{ ?? ??? ? ? ? ? ? ? findByzk(); ? ? ? ? ? ?//按是否在庫查詢 ?? ??? ? ? ? ? ? ? System.out.print("\n完成統(tǒng)計(jì)查詢圖書操作\n"); ?? ??? ? ? ? ? ? ? showMBorrow();break; ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?} ?? ? case 0:{ ? ? ?showMBorrow();} ?//返回上一菜單 ?? ? }} ?? ?//--------------按是否在庫查詢圖書---------------------- ?? ?public void findByzk(){ ?? ??? ??? ? System.out.print("請選擇在庫模式查詢:\n"); ?? ??? ??? ? System.out.println("1-顯示所有在庫圖書"); ?? ??? ??? ? System.out.println("2-顯示所有不在庫圖書"); ?? ??? ??? ? System.out.println("0-返回上一菜單"); ?? ?? ?? ??? ??? ? @SuppressWarnings("resource") ?? ??? ??? ? Scanner in1 =new Scanner(System.in); ?? ??? ??? ? int a; ?? ??? ??? ? a=in1.nextInt(); ?? ??? ??? ? while(a<0||a>3){ ?? ??? ??? ??? ??? ?System.out.print("該數(shù)字無效,請重新選擇:"); ?? ??? ??? ??? ??? ?a=in1.nextInt();} ?? ??? ??? ? switch(a){ ?? ??? ??? ? case 1:{ ?? ??? ??? ??? ? ?Borrow.showzkBook();break; ?//顯示所有在庫圖書 ?? ??? ??? ? } ?? ??? ??? ? case 2:{ ?? ??? ??? ??? ? ?Borrow.showbzkBook();break; ?//顯示所有不在庫圖書 ?? ??? ??? ? } ?? ??? ??? ? case 0:{ showMBorrow();} ?? ??? ??? ? } ?? ??? ?} } public class Tushu{ ? ? public static void main(String []args){ ? ? ? ? Menu menu =new Menu(); ? ? ? ? menu.showMenu(); ? ? } }
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- 圖書管理系統(tǒng)java版
- 一個(gè)簡陋的java圖書管理系統(tǒng)
- 圖書管理系統(tǒng)java代碼實(shí)現(xiàn)
- JAVA初級項(xiàng)目——實(shí)現(xiàn)圖書管理系統(tǒng)
- java實(shí)現(xiàn)圖書管理系統(tǒng)
- java實(shí)現(xiàn)簡單的圖書管理系統(tǒng)
- JAVA實(shí)現(xiàn)圖書管理系統(tǒng)項(xiàng)目
- java實(shí)現(xiàn)簡單圖書管理系統(tǒng)
- 配置idea將Java與數(shù)據(jù)庫連接起來實(shí)現(xiàn)一個(gè)簡單的圖書管理系統(tǒng)
相關(guān)文章
java阻塞隊(duì)列BlockingQueue詳細(xì)解讀
這篇文章主要介紹了java阻塞隊(duì)列BlockingQueue詳細(xì)解讀,在新增的Concurrent包中,BlockingQueue很好的解決了多線程中,如何高效安全“傳輸”數(shù)據(jù)的問題,通過這些高效并且線程安全的隊(duì)列類,為我們快速搭建高質(zhì)量的多線程程序帶來極大的便利,需要的朋友可以參考下2023-10-10Java基于Tcp協(xié)議的socket編程實(shí)例
這篇文章主要介紹了Java基于Tcp協(xié)議的socket編程實(shí)例,較為詳細(xì)的分析了socket編程客戶端與服務(wù)器端的具體實(shí)現(xiàn)步驟與使用技巧,具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2014-12-12Spring-AOP自動創(chuàng)建代理之BeanNameAutoProxyCreator實(shí)例
這篇文章主要介紹了Spring-AOP自動創(chuàng)建代理之BeanNameAutoProxyCreator實(shí)例,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2021-07-07Java中的BaseTypeHandler自定義類型轉(zhuǎn)換器的使用
這篇文章主要介紹了Java中的BaseTypeHandler自定義類型轉(zhuǎn)換器的使用,文章圍繞主題展開詳細(xì)的內(nèi)容介紹,具有一定的參考價(jià)值,需要的小伙伴可以參考一下2022-05-05Java使用反射和動態(tài)代理實(shí)現(xiàn)一個(gè)View注解綁定庫
這篇文章主要介紹了Java使用反射和動態(tài)代理實(shí)現(xiàn)一個(gè)View注解綁定庫,代碼簡潔,使用簡單,擴(kuò)展性強(qiáng),結(jié)合實(shí)例代碼給大家介紹的非常詳細(xì),需要的朋友可以參考下2022-05-05