Question

Which of the following best describes the control flow when a method in a subclass overrides a method in its superclass, and an object of the subclass is referred to by a superclass reference, then the overridden method is called? 

A The superclass method is executed due to static binding.
B The subclass method is executed due to dynamic polymorphism (runtime binding).
C A compilation error occurs because of method ambiguity.
D Both superclass and subclass methods are executed sequentially.
Practice Next

Hey! Ask a query