Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Java Programming Code Examples

Java > Other Code Examples

Deserialise object from file

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Deserialise object from file package com.ack.j2se.io; import java.io.FileInputStream; import java.io.IOException; import java.io.ObjectInputStream; public class DeserialiseObjectFromFile { public static void main( String[] args ) throws IOException, ClassNotFoundException { FileInputStream fin = new FileInputStream( "thefile.obj" ); ObjectInputStream ois = new ObjectInputStream( fin ); String str = (String) ois.readObject(); ois.close(); System.out.println( str ); } }