Created
August 17, 2015 01:05
-
-
Save jsyeo/71ab2a41076fbd21210e to your computer and use it in GitHub Desktop.
Subinterface for Class Hierarchy Analysis
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
| public class Main { | |
| public static void main(String[] args) { | |
| SuperInterface a = new ImplementerA(); | |
| a.foo(); | |
| SuperInterface b = new ImplementerB(); | |
| b.foo(); | |
| } | |
| } | |
| class ImplementerB implements SubInterfaceB { | |
| @Override | |
| public void baz() { | |
| } | |
| @Override | |
| public void foo() { | |
| } | |
| } | |
| class ImplementerA implements SubInterfaceA { | |
| @Override | |
| public void bar() { | |
| } | |
| @Override | |
| public void foo() { | |
| } | |
| } | |
| interface SubInterfaceA extends SuperInterface { | |
| void bar(); | |
| } | |
| interface SubInterfaceB extends SuperInterface { | |
| void baz(); | |
| } | |
| interface SuperInterface { | |
| void foo(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment