class A {
publicvoid play() {
}
staticvoid tune(A i) {
i.play();
}
}
// Wind objects are instruments
// because they have the same interface:
class B extends A {
}
publicclass MainClass {
publicstaticvoid main(String[] args) {
B flute = new B();
A.tune(flute); // Upcasting
}
}