Scala, Design Patterns, Programming, Delegation, Coding.
superclass method makeSound to use a class Sound parameter, but this could lead to runtime errors as the subtypes of the Animal class could be using an incorrect subtype of Sound class for the makeSound method and the compiler won’t rise any error as the method can have as parameter any subtype of