s-day10-序列化中的版本号问题
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
package com.inmind.object_stream03;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Student implements Serializable {
|
||||
@Serial
|
||||
//固定一个序列化版本号即可
|
||||
private static final long serialVersionUID = 7364427652531553411L;
|
||||
|
||||
String name;
|
||||
int age;
|
||||
/*
|
||||
@@ -33,4 +38,9 @@ public class Student implements Serializable {
|
||||
this.name = name;
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
|
||||
public void method(){
|
||||
System.out.println(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user