~/ learn/ java-from-zero/ cards/ default, static & private interface methods
1 of 4

Type an interface default method

Type an interface default method

Answer

default void logInfo(String msg) { log("[INFO] " + msg); }

default methods have a full body. Implementing classes inherit this method and may override it with @Override. This was the key Java 8 addition that enabled backward-compatible API evolution.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/e17f6566-5fd0-4dc0-a6b0-8b23459362fb/flashcard utf-8 LF