Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2012
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. package serialization;
  2.  
  3. import java.io.*;
  4.  
  5. public class SerializationReadSample {
  6.    
  7.     public static void main(String[]args) throws IOException, ClassNotFoundException{
  8.         FileInputStream fs =new FileInputStream("student.ser");
  9.         ObjectInputStream ois = new ObjectInputStream(fs);
  10.         Student st = (Student)ois.readObject();
  11.         System.out.println(st.id);
  12.     }
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement