
11.7 Reading and Writing Objects to a File 789
TABLE 11.11 Useful Classes,Constructors,and Methods for Reading Objects from a File
Classes,Constructors,and Methods for Reading Objects from a File
Class Constructors Exceptions Thrown
FileInputStream
ObjectInputStream
ObjectInputStream
FileInputStream( String filename )
constructs a FileInputStream object from a String represent-
ing the name of a file
ObjectInputStream( InputStream in )
constructs an ObjectInputStream from the InputStream in
Method API
Object readObject( )
reads the next object and returns it.The object must be an
instance of a class that implements the Serializable inter-
face. When the end ...