import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.io.Serializable;
import javax.swing.*;
import javax.swing.border.*;class Records {
    String name;
    long time;   
    Records(){}
    Records(String str,long spendtime){
     name  =  str;
     time = spendtime;
    }
} class v{
        
   public  static  Records[] read() {
   Records r[] = new Records[3];
   for(int k=0;k<3;k++)
     {
     r[k] = new Records();
     }
   try{
   
   FileInputStream file= new FileInputStream("score.dat");
   ObjectInputStream in = new ObjectInputStream(file);
   r = (Records[])in.readObject(); 
   System.out.println("read   finish");
   in.close();
  }
   catch(Exception ioAndNotfound){
   ioAndNotfound.getMessage();
   }
   return r;
}
      
  public  static void  write(Records []r){
       try{
      FileOutputStream fileout= new FileOutputStream("score.dat");
     ObjectOutputStream out = new ObjectOutputStream(fileout);
     out.writeObject(r);
     out.flush();
     out.close();
}
      catch(IOException io){
      io.getMessage();
      }
}
    
}
public class p{
     public static void main(String args[])
{
        Records []record = new Records[3];
    for(int l =0;l<3;l++)
   {
record[l] = new Records("null",000);
   }
record[0].name = "Jane";
record[0].time = 4;
record[1].name = "Hey";
record[1].time = 9;
record[2].name = "Jude";
record[2].time = 13;  
 Records re[] = new Records[3];
      for(int k=0;k<3;k++)
     {
     re[k] = new Records();
     }
      re = record;
      System.out.println("record[0].name"+record[0].name);
      System.out.println("re[0].name"+re[0].name);
     v.write(re);
 Records []t = new Records[3];
 t = v.read();
 System.out.println(t[0].name);//null
 System.out.println(t[1].name);//输出null
    }}就是最后两行输出了null  说明要么没写进去,要么是没读出来   整了一天了没整好,求教啊对象异常对象流