Practice · 1 of 5
Dispatch in a collection
CHALLENGE
Difficulty: intermediate+25 XP
Implement int countSpeakers(Animal[] zoo, String sound): count the animals whose speak() equals sound. Bird overrides legs too — trace which body runs for each call.
Press Submit to check your solution.
Back to lesson: Practice: Inheritance lab