1.

What Are Static Default Methods?

Answer»

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!!!");
}
}

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!!!");
}
}



Discussion

No Comment Found