This section describes:
To avoid type errors and class cast exceptions in programs, it is sometimes necessary to do type inquiry. There are two ways:
This section and others to follow use the following simple example of an inheritance hierarchy:
We will discuss the hashCode method later in the context of hash tables.
An object's data is structured like a tree, with the object the root and its instance fields the children. If an instance field is another object, then it too can be structured.

Sometimes it is necessary to convert an object into a flat, unstructured form, for example, to store it in a file or send it across a communication link.

Serialization is the process of storing an object and its dependent objects in a stream.