关于java 写的学生成绩管理系统中写入文件的问题,求高手解答
voidwrite(){try{FileOutputStreamfout=newFileOutputStream("aa.txt");DataOutputStreamou...
void write()
{
try
{
FileOutputStream fout=new FileOutputStream("aa.txt");
DataOutputStream out=new DataOutputStream(fout);
out.writeInt(len);
out.writeUTF(s[i].getName());
out.writeUTF(s[i].getSex());
out.writeInt(s[i].getId());
out.writeInt(s[i].getAge());
out.close();
System.out.println("保存成功");
}
catch(IOException E)
{}
}
哪儿出问题了 谢谢 展开
{
try
{
FileOutputStream fout=new FileOutputStream("aa.txt");
DataOutputStream out=new DataOutputStream(fout);
out.writeInt(len);
out.writeUTF(s[i].getName());
out.writeUTF(s[i].getSex());
out.writeInt(s[i].getId());
out.writeInt(s[i].getAge());
out.close();
System.out.println("保存成功");
}
catch(IOException E)
{}
}
哪儿出问题了 谢谢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询