栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > .Net

java找不到类list

.Net 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

java找不到类list

classnoteimplementsSerializable{Stringname,phone,MobilePhone,zip,address,Email;publicvoidSetnote(Stringname,Stringphone,StringMobilePhone,Stringzip,Stringaddress,StringEm...

class note implements Serializable{

String name,phone,MobilePhone,zip,address,Email;

public void Setnote(String name,String phone,String MobilePhone,String zip,String address,String Email)

{

this.name=name;

this.phone=phone;

this.MobilePhone=MobilePhone;

this.zip=zip;

this.address=address;

this.Email=Email;

}

public void show()

{

System.out.println(name+" "+phone+" "+MobilePhone+" "+zip+" "+address+" "+Email+" ");

}

}

public class notebook{

public static void main(String args[])throws IOException

{

System.out.print("**************通讯录系统**************n");

System.out.print("1--------------显示通讯录信息!---------n"

+"2--------------查找记录! ---------n"

+"3-------------- 退出 ---------n");

System.out.print("请选择操作:");

String s;

int Cto;

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

s=in.readLine();

Cto=Integer.parseInt(s);

while(Cto>3&&Cto<1){

System.out.print("选择错误的操作,请重新选择!");

s=in.readLine();

Cto=Integer.parseInt(s);

}

while(Cto>=1&&Cto<=3){

switch(Cto)

{

case 1:

下为显示记录的代码*********/

{

int i;

ArrayList Notelist=new ArrayList();

try{

ObjectInputStream infile=new ObjectInputStream(new FileInputStream("note.dat"));

Notelist=(ArrayList)infile.readObject();

infile.close();

}catch(Exception ex){}

if(Notelist.size()==0)

System.out.println("通讯录没有记录");

else

{

System.out.println("姓名"+" "+"固定电话"+" "+"手机 "+" "+"邮编 "+" "+"地址 "+" "+"电子邮件地址"+" ");

for(i=0;i

{

note Notebook=new note();

Notebook=(note)Notelist.get(i);

Notebook.show();

}

}

}

展开

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/984507.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号