1.

What Does The “static” Keyword Mean ? Can You Override Private Or Static Method In Java ?

Answer»

The static keyword DENOTES that a member variable or method can be accessed, WITHOUT requiring an instantiation of the class to which it belongs. A user cannot override static methods in Java, because method overriding is based upon dynamic binding at runtime and static methods are STATICALLY BINDED at compile time. A static method is not associated with any instance of a class so the concept is not APPLICABLE.

The static keyword denotes that a member variable or method can be accessed, without requiring an instantiation of the class to which it belongs. A user cannot override static methods in Java, because method overriding is based upon dynamic binding at runtime and static methods are statically binded at compile time. A static method is not associated with any instance of a class so the concept is not applicable.



Discussion

No Comment Found