I know that interface methods are implicitly public and abstract. Interface variables must always be public, static and final. Is there a specific reason interfaces can't have static methods?
static means 'one per class'
Usually we mark a method 'static' in a class and can call it without having to make an instance of that class.
In case of interfaces, where is the body of the method?
What will it execute, even if it is allowed.
If the methods of an interface are implicitly 'abstract' it means that the method body is not there.
All methods of interface of implicitely abstract, whcih should be overridden by the implementing class. As the static method can not be overridden, interface does not allow creation of static methods.
If you want to have some static method in your parent class, you can think of considering abstract class as the parent rathen than interface.
Regards
Salil Verma
We noticed he had no friends. So we gave him this tiny ad:
Gift giving made easy with the permaculture playing cards