Java - ClassNotFoundException I have the class included, but why do I get an exception?
- by aloh
public static Reservation[] openBinaryFile( String fileName )
{
Reservation [] objArray = null;
try
{
ObjectInputStream inStream = new ObjectInputStream(
new FileInputStream( fileName ) );
objArray = (Reservation[])inStream.readObject();
inStream.close();
}
catch( ClassNotFoundException e )
{
System.out.println( "Exception: ClassNotFoundException." );
}
I have the class included, but why do I get an exception? The class is in the same package as the others. Why am I getting this exception?