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*

9
  • 28
    Yes it is really a shame by the way that static methods cannot be overridden in Java. Commented Dec 16, 2008 at 11:29
  • 14
    @Michel: what would be the point? If you want instance based behavior, use instance methods. Commented Dec 16, 2008 at 12:12
  • 9
    This answer is incorrect. Static methods in abstract classes work fine and are commonly used. It's just that a static methods of the class itself may not be abstract. @Michel it doesn't make sense to override a static method. Without an instance, how would the runtime know which method to invoke? Commented Dec 16, 2008 at 15:57
  • 75
    @erickson - Even without an instance, the class hierarchy is intact - inheritance on static methods can work just like inheritance of instance methods. Smalltalk does it, and it is quite useful. Commented Jan 20, 2009 at 22:51
  • 9
    @matiasg that's nothing new at all. Abstract classes have always been allowed to have static, non-abstract methods. Commented Aug 9, 2012 at 12:41