Java overriding method explain java interview question interviewdot

798 views · Published 21 September 2013 · 2:17 · Indexed 24 October 2026

Channel: Interview DOT · 2013 · Science & Technology

Watch on YouTube

Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications. www.InterviewDot.com  -  Job Portal -- Java Interview Questions
Java overriding method explain java interview question interviewdot
Rules for overriding a method  in Java ?

  The argument list must exactly match that of the overridden method. If they don't match, you can end up with an overloaded method you didn't intend.

  The return type must be the same as, or a subtype of, the return type declared in the original overridden method in the superclass.

  The access level can't be more restrictive than the overridden method's.

  The access level CAN be less restrictive than that of the overridden method.

  Instance methods can be overridden only if they are inherited by the subclass.

  The overriding method CAN throw any unchecked (runtime) exception,regardless of whether the overridden method declares the exception.
A Job Portal
http://www.InterviewDot.com http://www.InterviewDot.com http://www.InterviewDot.com
One Click Dream Job - http://www.interviewdot.com/upload-resume/uploadresume.htm

Other Top Job Portals
www.Naukri.com
www.MonsterIndia.com
www.TimesJobs.com

Are you looking for a new Job ?
InterviewDot.com - A Job Portal
http://www.InterviewDot.com http://www.InterviewDot.com http://www.InterviewDot.com
One Click Dream Job - http://www.interviewdot.com/upload-resume/uploadresume.htm

More from this channel