The 30 second answer
Once interfaces had default methods, several of them often needed the same helper code. Before Java 9, the only option was another default or static method, which made that helper part of the public API. Since Java 9, an interface can have private methods, both instance and static, so default methods can share logic without exposing it to implementing classes or callers.
interface Report {
default String csv() { return render(","); }
default String tsv() { return render("\t"); }
private String render(String sep) { /* shared logic */ return ""; }
private static String escape(String s) { return s.replace("\"", "\"\""); }
}Private interface methods must have a body, are not inherited, and can't be default or abstract. They were delivered in Java 9 as part of JEP 213 ("Milling Project Coin").
Sources: JEP 213: Milling Project Coin, JLS 9.4 Method Declarations
Sources (0)
See inline citations in the answer above.