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
Regular methods can be abstract when they are meant to be overridden by subclasses and provided with functionality.
Imagine the class Foo
is extended by Bar1, Bar2, Bar3
etc. So, each will have their own version of the abstract class according to their needs.
Now, static methods by definition belong to the class, they have nothing to do with the objects of the class or the objects of its subclasses. They don't even need them to exist, they can be used without instantiating the classes. Hence, they need to be ready-to-go and cannot depend on the subclasses to add functionality to them.