Polymorphismus

15 Aufgaben · interaktiv
Instrument[] band = {new Gitarre(), new Trommel()}; for (Instrument i : band) i.spielen(); – Instrument gibt „Ton“ aus, Gitarre „Schrumm“, Trommel „Bumm“. Was erscheint?