Java序列化之四: 进一步思考
1,当需要被序列化的类对象中的一部分成员变量是不可被序列化的,会发生什么情况呢?
例如下面的的代码
public class Resume { private String work; public String getWork() { return work; } public void setWork(String work) { this.work = work; } public String getCollege() { return college; } public void setCollege(String college) { this.college = college; } private String college;} public Person(String str, int n) { System.out.println("Inside Person's Constructor"); name = str; age = n; } String getName() { return name; } int getAge() { return age; }}