完整代码:1.客户类(classperson):package客户管理系统;publicclassPerson{privateintnum;privateStringname;privateStringaddress;privateStringsex;publicPerson(){}publicPerson(intnum,Stringname,Stringaddress,Stringsex){this.num=num;this.name=name;this.address=address;this.sex=sex;}publicvoidsetNum(intnum){this.num=num;}publicintgetNum(){returnnum;}publicvoidsetName(Stringname){this.name=name;}publicStringgetName(){returnname;}publicvoidsetAddress(Stringaddress){this.address=address;}publicStringgetAddress(){returnaddress;}publicvoidsetSex(Stringsex){this.sex=sex;}publicStringgetSex(){returnsex;}publicStringtoString(){return\t+num+\t+name+\t+address+\t+sex;}}2.菜单类(classMenu):package客户管理系统;importjava.util.Scanner;publicclassMenu{Scannerinput=newScanner(System.in);publicMenu(){}publicintshowMenu(){System.out.println(***********************************);System.out.println(客户管理系统);System.out.println(===================================);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(***********************************);System.out.print(请选择操作:);returninput.nextInt();}publicintsubMenu(){System.out.println(\t【查询客户】);System.out.println(\t[1]按客户编号查询);System.out.println(\t[2]按客户姓名查询);System.out.println(\t[3]按地址查询);System.out.println(\t[4]退出);System.out.println(\t请选择查询编号);returninput.nextInt();}}3.实际操作类(classFileOperate):package客户管理系统;importjava.io.BufferedReader;importjava.io.File;importjava.io.FileNotFoundException;importjava.io.FileReader;importjava.io.IOException;importjava.io.PrintWriter;importjava.util.ArrayList;importjava.util.List;importjava.util.Scanner;publicclassFileOperate{privatestaticStringINFO=D:/info.dat;Filefile=newFile(INFO);Scannerinput=newScanner(System.in);publicFileOperate(){if(!file.exists()){try{file.createNewFile();}catch(IOExceptione){e.printStackTrace();}}}publicListPersongetList()throwsNumberFormatException,IOException{BufferedReaderbr=newBufferedReader(newFileReader(file));Stringmsg=null;ListPersonlist=newArrayListPerson();while((msg=br.readLine())!=null){Stringarr[]=msg.split(\t);intnum=Integer.parseInt(arr[0]);Stringname=arr[1];Stringaddress=arr[2];Stringsex=arr[3];Personperson=newPerson(num,name,address,sex);list.add(person);}br.close();returnlist;}privatevoidsavelist(ListPersonlist)throwsFileNotFoundException{PrintWriterpw=newPrintWriter(newFile(INFO));for(Personc:list){pw.format(%d\t%s\t%s\t%s\t\r\n,c.getNum(),c.getName(),c.getAddress(),c.getSex());}pw.close();}publicintgetper(intnum)throwsNumberFormatException,IOException{ListPersonlist=getList();for(inti=0;ilist.size();i++){Personper=list.get(i);if(num==per.getNum()){returni;}}return-1;}//增加publicvoidinsert()throwsNumberFormatException,IOException{System.out.println(请输入编号:);intnum=input.nextInt();intindex=getper(num);if(index!=-1){System.out.println(此编号已存在!);}else{System.out.println(请输入姓名:);Stringname=input.next();System.out.println(请输入地址:);Stringaddress=input.next();System.out.println(请输入性别:);Stringsex=input.next();Personperson=newPerson(num,name,address,sex);ListPersonlist=getList();list.add(person);savelist(list);System.out.println(新增成功!);}}//删除publicvoiddelete()throwsNumberFormatException,IOException{System.out.println(请输入要删除的编号:);intnum=input.nextInt();ListPersonlist=getList();booleanflag=false;for(inti=0;ilist.size();i++){Personper=list.get(i);if(num==per.getNum()){showTitle();System.out.println(per);System.out.println(是否确定删除(Y/N)?);Stringanswer=input.next();if(Y.equalsIgnoreCase(answer)){list.remove(i);savelist(list);System.out.println(删除成功!);}flag=true;break;}}if(!flag){System.out.println(该客户不存在!);}}//修改publicvoidupdate()throwsNumberFormatException,IOException{shoAll();System.out.println(请输入编号:\n);intnum=input.nextInt();intId=getper(num);if(Id!=-1){System.out.println(请输入姓名:);Stringname=input.next();System.out.println(请输入地址:);Stringaddress=input.next();System.out.println(请输入性别:);Stringsex=input.next();ListPersonlist=getList();Personper=list.get(Id);per.setName(name);per.setAddress(address);per.setSex(sex);showTitle();System.out.println(per);savelist(list);System.out.println(修改成功!);}else{System.out.println(编号不存在!);}}//查询publicvoidsearch()throwsNumberFormatException,IOException{booleanflag=true;ListPersonlist=getList();if(list.size()!=0){while(flag){intslt=newMenu().subMenu();switch(slt){case1:System.out.print(\t请输入编号:);findId(input.nextInt());break;case2:System.out.print(\t请输入姓名:);findName(input.next());break;case3:System.out.print(\t请输入地址:);findAddress(input.next());break;case4:flag=quit();break;}}}else{System.out.println(无任何信息!);}}//按编号查询publicvoidfindId(intnum)throwsNumberFormatException,IOException{ListPersonlist=getList();booleanflag=false;for(inti=0;ilist.size();i++){Personper=list.get(i);if(num==per.getNum()){showTitle();System.out.println(per);flag=true;break;}}if(!flag){System.out.println(\t该客户不存在!);}}//按姓名查询publicvoidfindName(Stringname)throwsNumberFormatException,IOException{ListPersonlis