1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-14 02:34:17 +02:00

java: In Java 8, interfaces can have default method. (#2337)

This commit is contained in:
Jakukyo Friel
2016-08-22 06:06:57 +08:00
committed by ven
parent d81e9735c2
commit 34456d988c

View File

@@ -585,6 +585,10 @@ public interface Edible {
public interface Digestible {
public void digest();
// In Java 8, interfaces can have default method.
// public void digest() {
// System.out.println("digesting ...");
// }
}
// We can now create a class that implements both of these interfaces.