mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-24 10:01:38 +00:00
Merge pull request #2892 from tobyjsullivan/fix-default-method
[java/en] Add default keyword
This commit is contained in:
commit
64b1378b11
@ -660,7 +660,7 @@ public interface Edible {
|
|||||||
public interface Digestible {
|
public interface Digestible {
|
||||||
public void digest();
|
public void digest();
|
||||||
// Since Java 8, interfaces can have default method.
|
// Since Java 8, interfaces can have default method.
|
||||||
public void defaultMethod() {
|
public default void defaultMethod() {
|
||||||
System.out.println("Hi from default method ...");
|
System.out.println("Hi from default method ...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user