-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Week3][Chap11] 인터페이스 다중구현 - Diamond 문제 (#26)
- Loading branch information
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
임준형/java-basic/src/main/java/week3/poly/diamond/Child.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package week3.poly.diamond; | ||
|
||
public class Child implements InterfaceA, InterfaceB{ | ||
@Override | ||
public void methodA() { | ||
System.out.println("Child.methodA"); | ||
} | ||
|
||
@Override | ||
public void methodB() { | ||
System.out.println("Child.methodB"); | ||
} | ||
|
||
@Override | ||
public void methodCommon() { | ||
System.out.println("Child.methodCommon"); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
임준형/java-basic/src/main/java/week3/poly/diamond/DiamondMain.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package week3.poly.diamond; | ||
|
||
public class DiamondMain { | ||
public static void main(String[] args) { | ||
InterfaceA a = new Child(); | ||
a.methodA(); | ||
a.methodCommon(); | ||
|
||
InterfaceB b = new Child(); | ||
b.methodB(); | ||
b.methodCommon(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
임준형/java-basic/src/main/java/week3/poly/diamond/InterfaceA.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package week3.poly.diamond; | ||
|
||
public interface InterfaceA { | ||
void methodA(); | ||
void methodCommon(); | ||
} |
6 changes: 6 additions & 0 deletions
6
임준형/java-basic/src/main/java/week3/poly/diamond/InterfaceB.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package week3.poly.diamond; | ||
|
||
public interface InterfaceB { | ||
void methodB(); | ||
void methodCommon(); | ||
} |