Advanced
Compilers & Programming Language Theory
Q88 / 100
What is the difference between early and late binding in object-oriented languages?
Correct! Well done.
Incorrect.
The correct answer is B) Early binding (static dispatch): method resolved at compile time by static type; late binding (dynamic dispatch): resolved at runtime by actual object type via vtable/dispatch
B
Correct Answer
Early binding (static dispatch): method resolved at compile time by static type; late binding (dynamic dispatch): resolved at runtime by actual object type via vtable/dispatch
Explanation
C++: non-virtual methods are early bound (direct call). Virtual methods are late bound (vtable lookup). Java: all non-final methods are late-bound. Late binding enables polymorphism; early binding enables inlining.
Progress
88/100