Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 15
    Few reasons: static method must have a body even if they are part of abstract class because one doesn't need to create instance of a class to access its static method. Another way to think about it is if for a moment we assume it is allowed then the problem is that static method calls don't provide any Run Time Type Information (RTTI), remember no instance creation is required, thus they can't redirected to their specific overriden implementations and thus allowing abstarct static makes no sense at all. In other words, it couldn't provides any polymorphism benefit thus not allowed. Commented Nov 10, 2016 at 16:18
  • 1
    This question was asked about 15 years ago. Isn't there a way to use (popper) Annotations (at pre-compile time) to harshly indicate that a static method in an abstract class should be overridden? Commented Oct 23, 2023 at 19:59
  • "Why?" Because the Java Language Specification does not allow it: JLS8.4.3. Method Modifiers: "It is a compile-time error if a method declaration that contains the keyword abstract also contains any one of the keywords private, static, final, native, strictfp, or synchronized." (original emphasis) Commented Nov 18 at 0:02