Type a polymorphic assignment and call
Type a polymorphic assignment and call
Answer
Shape s = new Circle(); System.out.println(s.describe());
s is declared as Shape but holds a Circle. The call to describe() dispatches to Circle.describe() at runtime — that is polymorphism. The reference type governs what methods are visible; the object type governs which body runs.