Describe the difference between method overloading and method overriding in OOP.
- Overloading means having methods with the same name but different parameters.
- Overloading means replacing a method in a subclass.
- Overriding means having methods with the same name but different parameters.
- Overriding means replacing a method in a subclass.
Method overloading in OOP refers to defining multiple methods in the same class with the same name but different parameters. Method overriding, on the other hand, involves replacing a method in a subclass with a new implementation. This distinction is crucial for polymorphism and code reuse.
Loading...
Related Quiz
- When is dynamic programming preferable over greedy algorithms?
- The process of breaking down a large table into smaller tables and defining relationships between them is known as ___________.
- What is the purpose of the testing phase in the SDLC?
- What is the purpose of the "Content-Type" header in RESTful API requests?
- The ___________ provides a mapping between file names and their corresponding inodes.