We have launched a free Basic Kubernetes Course. Click here to enrol now! Kubernetes is a container orchestration platform used by enterprises worldwide and Kubernetes developers are in high demand!
ObjectInputStream can be used to de-serialize and read java objects that have been serialized and written using ObjectOutputStream. In the example below the ‘Course’ object is written to a persistent storage. The Course object contains a list of Student objects. The object writing preserves object references. We first create an object output stream that stores the bytes to a file using a FileOutputStream.
The Course Class
The Student Class