This is a typical interview question. What are the rules of overriding. Here goes the answer
- The method in the subclass should have the same signature as that of the method in super class
- The method in subclass should not be more restrictive in the context of access specifiers
- The method that overrides the method in super class cannot be through broader exception meaning that it cannot throw the super class of exception thrown by super class.
- "final" method cannot be overridden