import java.util.*; public class Client { public static void main(String[] args) { MusicPlayer p1 = new MusicPlayer(); MP3Player p2 = new MP3Player(); CDPlayer p3 = new CDPlayer(); IPhone p4 = new IPhone(); /* System.out.print("p1: "); p1.play(); System.out.print("p2: "); p2.selectSong("All Star"); p2.play(); System.out.print("p3: "); p3.play(); System.out.print("p4: "); p4.selectSong("Happy Birthday"); p4.play(); */ // p4.record(); COMPILER ERROR: can't find symbol // p2.makeCall(8675309); same compiler error // left hand side: promise type, declared type, reference type // right hand side: actual type, object type, implementation type //MP3Player p5 = new IPhone(); //((IPhone)p5).makeCall(8675309); List list = new ArrayList(); list.add(new IPhone()); list.add(new Zune()); list.add(new IPod()); list.add(new MP3Player()); ((IPhone)list.get(0)).makeCall(8675309); ((IPhone)list.get(0)).playSolitare(); ((Zune)list.get(1)).useRadio(92.5); ((IPod)list.get(2)).playSolitare(); ((IPhone)list.get(3)).selectSong("Twinkle Twinkle Little Star"); list.get(3).play(); } }