What is the difference between compile-time and run-time polymorphism in object-oriented programming?

1 Answers
Answered by suresh

```html

Compile-time vs Run-time Polymorphism in Object-Oriented Programming

Compile-time vs Run-time Polymorphism in Object-Oriented Programming

Compile-time polymorphism is resolved during the compilation phase of the program, where the decision on which method to call is made by the compiler based on the method signature and the arguments passed. This is achieved through method overloading and operator overloading.

On the other hand, run-time polymorphism is resolved during the execution of the program, dynamically binding the method to call based on the runtime object. This is achieved through method overriding using inheritance and interfaces.

The key difference between compile-time and run-time polymorphism lies in the timing of method resolution – compile-time polymorphism is determined during compilation, while run-time polymorphism is resolved during program execution.

Focus keyword: Compile-time vs Run-time Polymorphism in Object-Oriented Programming

```

Answer for Question: What is the difference between compile-time and run-time polymorphism in object-oriented programming?