What is method overloading?
A) Defining multiple methods with the same name in the same class but with different parameters.
B) Overriding a method in a subclass.
C) Creating a method that can take any number of parameters.
D) Hiding a method from subclasses.
Answer: A) Defining multiple methods with the same name in the same class but with different parameters.
Explanation: Method overloading is a feature that allows a class to have more than one method with the same name, as long as their parameter lists differ in type or number. This increases the readability and usability of the code. Method overriding, on the other hand, occurs when a subclass provides a specific implementation for a method that is already defined in its parent class.