Можете разъяснить?
package com.javarush.task.pro.task17.task1715;
import java.util.ArrayList;
import java.util.List;
/*
Вилларибо и Виллабаджо.
*/
public class Solution {
static List<MusicalInstrument> orchestra = new ArrayList<>();
public static void main(String[] args) {
createKeyboardOrchestra();
createStringedOrchestra();
playOrchestra();
}
public static void createKeyboardOrchestra() {
ArrayList orchestra = new ArrayList();
orchestra.add(new Organ());
orchestra.add(new Piano());
orchestra.add(new Piano());
orchestra.add(new Piano());
}
public static void createStringedOrchestra() {
ArrayList orchestra = new ArrayList();
orchestra.add(new Violin());
orchestra.add(new Violin());
orchestra.add(new Guitar());
}
public static void playOrchestra() {
for (Object s: orchestra)
{
MusicalInstrument musicalInstrument = (MusicalInstrument)s;
musicalInstrument.play();
}
}
}