Java序列化的简单例子Java认证考试
文章作者 100test 发表时间 2010:01:24 17:38:13
来源 100Test.Com百考试题网
首先来看看要序列化的对象
Person.java
package com.zjut.yunfeiyang.
import java.io.Serializable.
public class Person implements Serializable{
private static final long serialVersionUID = -5434734211562785652L.
public Person() {
}
private String name.
private String password.
private String id.
private String address.
/**
* @return the name
*/
public String getName() {
return name.
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name.
}
/**
* @return the password
*/
public String getPassword() {
return password.
}