0
What are static default methods in Java8?

Open 1 Answers 25 Views Education

What are static default methods in Java8?

1 Answer

0
What are static default methods in Java8?

An interface can also have static helper methods from Java 8 onwards.

public interface vehicle {

   default void print() {

      System.out.println("I am a vehicle!");

   }

 

   static void blowHorn() {

      System.out.println("Blowing horn!!!");

   }

}
by (54.6k points)
...