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