}In the next example, we aim a superclass reference at a subclass object.
§Invoking a method on a subclass object via a superclass reference invokes the subclass functionality
§The type of the referenced object, not the type of the variable, determines which method is called
}This example demonstrates that an object of a subclass can be treated as an object of its superclass, enabling various interesting manipulations.
}A program can create an array of superclass variables that refer to objects ofmany subclass types.
§Allowed because each subclass object is an object of its superclass.
}A superclass object cannot be treated asa subclass object, because a superclass object is not anobject of any of its subclasses.
}The is-a relationship applies only up the hierarchy from a subclass to its direct (and indirect) superclasses, and not down the hierarchy.
}The Java compiler does allow the assignment of a superclass reference to a subclass variable if you explicitly cast the superclass reference to the subclass type
§A technique known as downcasting that enables a program to invoke subclass methods that are not in the superclass.

