Polymorphism in Java
Q. Does Java support polymorphism?
A. Yes, via the use of the built-in, general class Object.
public class Widget extends Object {
public void setName(String n) {name = n;}
public Widget test(Widget w) {
Widget w2 = (Widget) w.clone();
w2.setName(“The cloned Widget”);