diff --git "a/\352\271\200\354\225\204\353\246\260/java-basic/src/extends1/super1/Child.java" "b/\352\271\200\354\225\204\353\246\260/java-basic/src/extends1/super1/Child.java" new file mode 100644 index 0000000..2b62565 --- /dev/null +++ "b/\352\271\200\354\225\204\353\246\260/java-basic/src/extends1/super1/Child.java" @@ -0,0 +1,18 @@ +package extends1.super1; + +public class Child extends Parent { + public String value = "child"; + + @Override + public void hello() { + System.out.println("Child.hello"); + } + + public void call() { + System.out.println("this value = " + this.value); // this 생략 가능 + System.out.println("super value = " + super.value); + + this.hello(); // this 생략 가능 + super.hello(); + } +} diff --git "a/\352\271\200\354\225\204\353\246\260/java-basic/src/extends1/super1/Parent.java" "b/\352\271\200\354\225\204\353\246\260/java-basic/src/extends1/super1/Parent.java" new file mode 100644 index 0000000..4987ab5 --- /dev/null +++ "b/\352\271\200\354\225\204\353\246\260/java-basic/src/extends1/super1/Parent.java" @@ -0,0 +1,9 @@ +package extends1.super1; + +public class Parent { + public String value = "parent"; + + public void hello() { + System.out.println("Parent.hello"); + } +} diff --git "a/\352\271\200\354\225\204\353\246\260/java-basic/src/extends1/super1/Super1Main.java" "b/\352\271\200\354\225\204\353\246\260/java-basic/src/extends1/super1/Super1Main.java" new file mode 100644 index 0000000..cbb1d6e --- /dev/null +++ "b/\352\271\200\354\225\204\353\246\260/java-basic/src/extends1/super1/Super1Main.java" @@ -0,0 +1,8 @@ +package extends1.super1; + +public class Super1Main { + public static void main(String[] args) { + Child child = new Child(); + child.call(); + } +}