public class ObjectIOStream
extends java.lang.Object
Constructor and Description |
---|
ObjectIOStream() |
Modifier and Type | Method and Description |
---|---|
static void |
input()
Reads an input SuffolkResident object with student name, grade
and credits data from a binary ObjectInputStream file and writes
the object's toString() method return value to the terminal window.
|
static void |
main(java.lang.String[] args)
Driver method for ObjectOutputStream and ObjectInputStream demo.
|
static void |
output()
Writes an output SuffolkResident object with student name, grade
and credits data to a binary ObjectOutputStream file.
|
public static void main(java.lang.String[] args)
args
- the String[] array command line parameterpublic static void output() throws java.io.IOException
java.io.IOException
- for any file operation failure related to the 'temp.dat' filejava.util.InputMismatchException
- if user enters non-integer input for 'credits'public static void input() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
- for any file operation related to the 'temp.dat' filejava.lang.ClassNotFoundException
- if the JVM cannot load the SuffolkResident class