Why can't static methods be abstract in Java?

hhafez picture hhafez · Dec 16, 2008 · Viewed 279.3k times · Source

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
    abstract static void bar2(); //<-- this isn't why?
}

Answer

Tomalak picture Tomalak · Dec 16, 2008

Because "abstract" means: "Implements no functionality", and "static" means: "There is functionality even if you don't have an object instance". And that's a logical contradiction.