Multiple choice java

Overriding and Overloading is for ?

  1. Methods and variables

  2. Class

  3. Variables

  4. Methods

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Overriding (runtime polymorphism through inheritance) and overloading (compile-time polymorphism with same name, different parameters) are concepts that apply specifically to methods in object-oriented programming. They are not applicable to variables or classes.