Example #1
0
 public void tuneInstrument(MusicInstrument inst) throws MyMusicInstrumentException {
   if (inst.getName().equals("")) {
     throw new MyMusicInstrumentException("Exception");
   }
   inst.tune();
 }
Example #2
0
 public ArrayList<String> getNamesOfInstrument() {
   for (MusicInstrument inst : instruments) {
     allInstrumentNames.add(inst.getName());
   }
   return allInstrumentNames;
 }