进阶day10-序列化中的版本号问题

This commit is contained in:
2026-03-23 17:04:51 +08:00
parent b6b5c8ab39
commit ab3a5598a7
3 changed files with 12 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ public class Demo11 {
Student s = new Student("张三", 20);
//序列化将java对象保存到文件中
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("student2.txt"));
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("student3.txt"));
oos.writeObject(s);
oos.close();