java method overload inheritance and polymorphism
问题 Here's a test practice question i came across, would appreciate your help in making me understand the concepts Let Hawk be a subclass of Bird. Suppose some class has two overloaded methods void foo(Hawk h) and void foo(Bird b). Which version would get executed in the call foo(x) after the declaration Bird x = new Hawk(); Here's the code i have so far, could someone explain to me why foo(bird b) gets executed? public class MPractice { public static void main(String args[]) { Bird x = new Hawk(