<p>Polymorphism:
ObjectHigherInHierarchy obj = new ObjectLowerInHierarchy(); -> Perfectly OK</p>
<p>ObjectHigherInHierarchy otherObject = something here…;
ObjectLowerInHierarchy obj2 = (ObjectLowerInHierarchy) otherObject; → Possible ClassCastException if otherObject isn’t an instance of ObjectLowerInHierarchy or an object lower in the hierarchy than ObjectLowerInHierarchy.</p>
<p>Methods run when they are called on. To check for whether it compiles or not, just examine the syntax.</p>