View RSS Feed

Java Object

Object-oriented programming in Java.

  1. Rules for method overriding

    by , 04-26-2012 at 06:56 PM
    Overridden method and argument list shall exactly be the same
    Return type shall be the subtype that is being declared in original method that is overridden in superclass, or it shall be the same.
    Restriction is not more in case of access level as compared to access level of the overridden method. E.g, when superclass is considerd to be public, in that case overriding method present in the subclass would not be public or private. But access level might not be much restrictive ...