Examveda

In Java, can a subclass overload a method from its superclass?

A. Yes, as long as the method is marked as "private"

B. No, method overloading is not allowed in Java

C. No, method overloading is not supported

D. None of These

Answer: Option D

Solution (By Examveda Team)

Method overloading occurs when two or more methods in the same class (or subclass and superclass) have the same name but different parameter lists.

In Java, a subclass can overload a method from its superclass by defining a method with the same name but a different parameter list.

Option A is incorrect because a method marked as private in the superclass is not visible to the subclass, so it cannot be directly overloaded.

Option B and C are incorrect because method overloading is a fundamental feature of Java and is fully supported.

Therefore, the correct answer is Option D: None of These since none of the given options correctly describe method overloading in Java.

This Question Belongs to Java Program >> Overriding And Overloading

Join The Discussion

Comments (1)

  1. Gopal Ambore
    Gopal Ambore:
    4 months ago

    This question's answer is wrong

Related Questions on Overriding and Overloading