Java / Methods
How to invoke a static method of an interface?
Invoke the static method using the name of the interface.
public interface Animal { static void doSwim() { System.out.println("Animal can swim"); } } public class Dog implements Animal { public void canSwim() { Animal.doSwim(); } }
More Related questions...