Created
July 10, 2012 16:51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.ocjp.serializable; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.ObjectInputStream; | |
public class Input { | |
public static void main(String[] args) throws IOException, ClassNotFoundException { | |
FileInputStream f = new FileInputStream("C:\\temp\\animal.ser"); | |
ObjectInputStream in = new ObjectInputStream(f); | |
Dog a2 = (Dog)in.readObject(); | |
System.out.println("Age ==> " + a2.age); | |
System.out.println("Name ==> " + a2.name); | |
System.out.println("Kind ==> " + a2.kind); | |
System.out.println("Owner ==> " + a2.owner); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment