NEW INTERVIEW QUESTIONS.COM
J2EE INTERVIEW QUESTIONS
JAVA INTERVIEW QUESTIONS DETAILS
NewInterviewQuestions.com - Home for World's Largest Interview Questions Website.
A D V E R T I S E M E N T
Question |
What restrictions are placed on method overriding? |
Answer
|
Overridden methods must have the same name, argument list, and return type. The overriding method may not limit the access of the method it overrides. The overriding method may not throw any exceptions that may not be thrown by the overridden method.
Overridden methods must have the same name, argument list and return type.we can do overriding only in sub class but not in super class.
Answered By: Samatha.p Date: 7/18/2007
Methods are Overridden in inheritance.These should have same name,same return-type,same argument-list and same access specifier.Unlike c++, access specifiers i.e private,public,default,etc. can't differ in overridden methods.
Answered By: Charu Date: 8/30/2008
© NewInterviewQuestions.com
|
If you have the better answer, than send it to us. We will display your answer after the approval.
Rate the above answer. Help us to know about the answer.
Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.
A D V E R T I S E M E N T
|