Java输入输出及文件操作.pptVIP

  • 4
  • 0
  • 约2.4万字
  • 约 86页
  • 2017-11-17 发布于河南
  • 举报
Java输入输出及文件操作

* * * * * * * * * v * * 9.5.3 接口Serializable和对象的串行化 对象流是怎样工作的? 允许可串行化的对象在流中传输 1.只有实现serializable接口的类才能被串行化 public class Student implements Serializable { int id;String name; int age; String department; public Student(int id, String name,int age, String department) { this.id=id; this.name=name; this.age=age; this.department =departmernt; } } * 9.5.3 接口Serializable和对象的串行化 2. 构造对象的输入输出流(将对象保存到文件中,或者通过网络传送到其他地方) 相应的类:ObjectInput 对象的输出: ObjectOutputStream 相应的方法:writeObject() 对象的输入:ObjectInputStream 相应的方法:readObject() 注:jdk1.1以上版本支持对象流操作

文档评论(0)

1亿VIP精品文档

相关文档