<<< class SavePerson | Index | Week 14 Reading: pages 181-194 >>> |
import java.io.*; import java.util.*; public class RestorePerson{ public static void main( String args[] ) { try{ FileInputStream fis = new FileInputStream( "Name.txt" ); ObjectInputStream ois = new ObjectInputStream( fis ); Person person = ( Person ) ois.readObject(); System.out.print( "Person Name Restored: " ); System.out.println( person.getName() ); ois.close(); } catch ( Exception e ) { e.printStackTrace(); } } }
<<< class SavePerson | Index | Week 14 Reading: pages 181-194 >>> |