124k views
2 votes
When a superclass variable refers to a subclass object and a method is called on that object, the proper implementation is determined at execution time. What is the process of determining the correct method to call?

2 Answers

3 votes

Question With Options:

When a superclass variable refers to a subclass object and a method is called on that object, the proper implementation is determined at execution time. What is the process of determining the correct method to call?

a. early binding.

b. non-binding.

c. on-time binding.

d. late binding.

Answer:

d. late binding

Step-by-step explanation:

In computer programming, binding generally means assigning identifiers to memory locations. By identifiers, we mean variable and function names. This binding can either be done at compile time or run(execution) time. When it is done at compile-time, it is called early binding. Otherwise, when it is done at execution time, it is called late binding.

Therefore, when the superclass variable refers to the subclass object and a method is called on that object, the proper implementation determined at execution time is a process called late binding.

User Cephalopod
by
4.5k points
6 votes

Answer:

D. Late binding

Step-by-step explanation:

a. early binding.

b. non-binding.

c. on-time binding.

d. late binding.

The compiler performs a process called binding when an object is assigned to an object variable. The early binding (static binding) refers to compile time binding and late binding (dynamic binding) refers to runtime binding. Another name for late binding is dynamic linkages

It is a computer programming mechanism in which the method being called upon an object or the function being called with arguments is looked up by name at runtime.

When a superclass variable refers to a subclass object and a method is called on that object, the proper implementation is determined at execution time. The process of determining the correct method to call is known as Late Binding.

User Hitesh Misro
by
4.8k points