If a superclass A has a method foo and a derived class B has
If a superclass A has a method foo() and a derived class B has a method foo(), which method is called by the following code:
B b = new B();
 A a = b;
 a.foo();
| The foo() method in class B. | 
Solution
Answer: The foo() method in class B.
We created instance of B and assinged it to parent class instance.
Though we are calling foo() method by superclass object, derived class foo() method will invoke.

