mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-01-14 21:25:58 +00:00
java: In Java 8, interfaces can have default method. (#2337)
This commit is contained in:
parent
d81e9735c2
commit
34456d988c
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user