首页 > 其他 > 详细

认可的一天

时间:2019-05-30 21:29:43      阅读:66      评论:0      收藏:0      [点我收藏+]

import  java.io.Externalizable;

import java.io.IOException;

import java.io.ObjectInput;

import java.io.ObjectOutput;

public class Person implements Externalizable{

  private String name;

private int age;

  public Person(){}

  public Person(String name, int age){

    this.name=name;

    this.age=age;

}

  public String toString(){

    return"性别:"+this.name+:";年龄:"+this.age;

}

  public void readExternal(ObjectInput in)throws IOException,

    ClassNotFoundException{

  this.name=(String)in.readObject();

  this.age=in.readInt();

}

  public void writeExternal(ObjectOutput out)throws IOException{

  out.writeObject(this.name);

  out.writeInt(this.age);

 

}

 

}

认可的一天

原文:https://www.cnblogs.com/l2760186162/p/10951844.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!