}
被序列化对象类 该类必须实现serializable 接口
package test;
import java.io.Serializable;
public class Person implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
int num;
String color;
public Person(){}
public Person(int num,String color){
this.num = num;
this.color = color;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}