Scala, Design Patterns, Programming, Delegation, Coding.
new Dog("Scooby Doo", Location(4, 2)) val fox: Fox = new Fox("Robin Hood", Location(6, 4)) System.out.println(dog.toString) dog.makeSound(new BurkSound) System.out.println(fox.toString) fox.makeSound(new BurkSound) } Supposing as shown in the previous code example that you have the implementations