子类和继承:编写主类MyApp,在主类MyApp的main方法中至少包含如下代码:
Simulator simulator=new Simulator();
simulator. playSound (new Dog());
simulator.playSound (new Cat ());
Simulator simulator=new Simulator();
simulator. playSound (new Dog());
simulator.playSound (new Cat ());