When we are overloading or overriding the methods how we want to take care about the acess specifiers?

Showing Answers 1 - 3 of 3 Answers

SrinivasaRao.T

  • Jun 16th, 2006
 

When we override a method in the child class, that method sould not be a private in parent class, but that method should be public or protected or default, those methods should have the same signature.

But we can overload the method within the same class or in the child class but they have some difference in having no of arguments or type of arguments. if we overload the method within the class we can use any access specifier, if we overload in child class dont use private.

  Was this answer useful?  Yes

rajesh chawhan

  • Jul 27th, 2006
 

hi

i am an electronics & telecommunication engineer.

i have one year exprience in java

  Was this answer useful?  Yes

sneh lata

  • Sep 15th, 2007
 

when we are overloading or overriding the methods , In subclass we have to give same access specifier or we can give such access specifier who has higher accessibility                             

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions