CSE 341 -- S. Tanimoto                                                                    Java Classes and Inheritance
15
Upcasting and Downcasting
Upcasting occurs when an object of one type is assigned to a variable declared with a supertype of the object.  No explicit casting is needed:
Polyhedron p = new Cube(5);
Downcasting, however, requires an explicit cast:
Cube c = (Cube) p;