Question: OOP IN JAVA! 6 Which of the following statements is false? A: Method overloading is a form of static polymorphism. The methods share the same
OOP IN JAVA! 6
Which of the following statements is false?
A: Method overloading is a form of static polymorphism. The methods share the same name but at compilation, the compiler can determine which implementation to bind to which method calls based on the lists of parameters.
B: All of these are examples of some kind of polymorphism.
C: Method inheritance/overriding is a form of dynamic polymorphism. Its not possible for the compiler to determine at compilation which implementation of an inherited/overridden method to bind to which method call so the JRE handles it by accessing the runtime object and checking the class hierarchy for the correct method definition.
D: Substitution is a form of static polymorphism because the actual objects are known at compile time. This allows us to substitute subtypes when some method expects super-types of a certain class hierarchy.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
