WHAT DOES THE “STATIC” KEYWORD MEAN ? CAN YOU OVERRIDE PRIVATE OR STATIC METHOD IN JAVA ?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
Java 
 483  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    What does the “static” keyword mean ? Can you override private or static method in Java ?

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!