The overload chosen by the declared type
A class has handle(Animal a) and handle(Dog d). Given:
Animal a = new Dog();
handle(a);
The Animal version runs. Why?
A class has handle(Animal a) and handle(Dog d). Given:
Animal a = new Dog();
handle(a);
The Animal version runs. Why?