//: Music1.java // Overloading instead of upcasting class Note1 { private int value; private Note1(int val) { value = val; }; public static final Note1 middleC = new Note1(0), cSharp = new Note1(1), cFlat = new Note1(2); } class Instruments1 { public void play(Note1 n) { System.out.println("Instrument1.play()"); } } class Wind1 extends Instruments1 { public void play(Note1 n) { System.out.println("Wind1.play()"); } } public class Music1 { public static void tune(Wind1 i) { i.play(Note1.middleC); } public static void main(String[] args) { Wind1 flute = new Wind1(); tune(flute); } }