mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-15 19:24:50 +02:00
java: In Java 8, interfaces can have default method. (#2337)
This commit is contained in:
@@ -585,6 +585,10 @@ public interface Edible {
|
|||||||
|
|
||||||
public interface Digestible {
|
public interface Digestible {
|
||||||
public void digest();
|
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.
|
// We can now create a class that implements both of these interfaces.
|
||||||
|
Reference in New Issue
Block a user