Created
December 21, 2017 09:14
-
-
Save laszlovandenhoek/504d09e9f88172fdc77189b3ffbf9f36 to your computer and use it in GitHub Desktop.
Composition in Java only goes so far :(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class What { | |
public abstract String foo(); | |
} | |
interface How { | |
default String foo() { | |
return "foo"; | |
} | |
} | |
public class Concrete extends What implements How { | |
//not so fast, Bob: | |
@Override | |
public String foo() { | |
return How.super.foo(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment