Why can't static methods be abstract in Java?

后端 未结 25 2258
不思量自难忘°
不思量自难忘° 2020-11-22 08:34

The question is in Java why can\'t I define an abstract static method? for example

abstract class foo {
    abstract void bar( ); // <-- this is ok
    ab         


        
25条回答
  •  礼貌的吻别
    2020-11-22 08:59

    Because 'abstract' means the method is meant to be overridden and one can't override 'static' methods.

提交回复
热议问题