Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
No,Not Possible.
Explanatation:1)STATIC means one per class,not one for each object no mater how many instances of a class exist.Since OVERRIDING is done based on object ,and also as STATIC METHODS are attached to a CLASS,not to an object,we cannot override STATIC METHODS.
2)Anything declared as PRIVATE ,cannot be accessed outside the class,wherein which it has been defined.Since PRIVTE METHODS of SUPER CLASS are not accessible from a SUB CLASS,we cannot override them.
No it is not possible to override a private method because a private method is accessible only in the declared class. Method overriding is to provide a different implementation for the method in the subclass. If a subclass cannot access a method there is no meaning of overriding the method.
Static methods are not overridden but inherited by the subclass. If a static method defined in superclass is redefined in subclass the static method in superclass is hidden.
N0 we cannot override private and static methods in java.....if we want t00verride we firstly changed it into public or protected then we can0verride..