Q:
What are the restrictions when overriding a method ?
Answer
Overridden methods must have the same name, argument list, and return type (i.e., they must have the exact signature of the method we are going to override, including return type.)
The overriding method cannot be less visible than the method it overrides( i.e., a public method cannot be override to private).
The overriding method may not throw any exceptions that may not be thrown by the overridden method
View answer
Workspace
Report Error
Discuss