Example program to demonstrate the inheritance relationship of reference pointers on a class hierarchy.