From 35facc88fc6826fa077345bc57834b7a6f2ad406 Mon Sep 17 00:00:00 2001 From: arinming Date: Tue, 6 Feb 2024 03:21:02 +0900 Subject: [PATCH] =?UTF-8?q?[Week3][Chap11]=20=EC=9D=B8=ED=84=B0=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4=20-=20=EB=8B=A4=EC=A4=91=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20(#27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java-basic/src/poly/diamond/Child.java" | 18 ++++++++++++++++++ .../src/poly/diamond/DiamondMian.java" | 16 ++++++++++++++++ .../src/poly/diamond/InterfaceA.java" | 7 +++++++ .../src/poly/diamond/InterfaceB.java" | 7 +++++++ 4 files changed, 48 insertions(+) create mode 100644 "\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/Child.java" create mode 100644 "\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/DiamondMian.java" create mode 100644 "\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/InterfaceA.java" create mode 100644 "\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/InterfaceB.java" diff --git "a/\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/Child.java" "b/\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/Child.java" new file mode 100644 index 0000000..39cba86 --- /dev/null +++ "b/\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/Child.java" @@ -0,0 +1,18 @@ +package 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"); + } +} diff --git "a/\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/DiamondMian.java" "b/\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/DiamondMian.java" new file mode 100644 index 0000000..0c544e4 --- /dev/null +++ "b/\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/DiamondMian.java" @@ -0,0 +1,16 @@ +package poly.diamond; + +public class DiamondMian { + public static void main(String[] args) { + InterfaceA a = new Child(); + a.methodA(); + a.methodCommon(); + + InterfaceB b = new Child(); + b.methodB(); + b.methodCommon(); + + Child child = new Child(); + child.methodCommon(); + } +} diff --git "a/\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/InterfaceA.java" "b/\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/InterfaceA.java" new file mode 100644 index 0000000..1e3354b --- /dev/null +++ "b/\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/InterfaceA.java" @@ -0,0 +1,7 @@ +package poly.diamond; + +public interface InterfaceA { + void methodA(); + + void methodCommon(); +} diff --git "a/\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/InterfaceB.java" "b/\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/InterfaceB.java" new file mode 100644 index 0000000..529ac02 --- /dev/null +++ "b/\352\271\200\354\225\204\353\246\260/java-basic/src/poly/diamond/InterfaceB.java" @@ -0,0 +1,7 @@ +package poly.diamond; + +public interface InterfaceB { + void methodB(); + + void methodCommon(); +}