Save the following Java program to your home directory: InheritanceExample.java
Compile and run the code. Notice how the instanceof operator is used to determine an object's type. Take some time to experiment with this code. Change the objects created and see how the program's output changes.