728x90 java super1 [JAVA] ch07-15. 객체 지향 15 public class Ex15 { public static void main(String[] args){ Super parent = new Sub2(); Sub2 child = new Sub2(); System.out.println(parent.x); System.out.println(child.x); parent.method(); child.method(); } } class Sub2 extends Super{ } JAVA/예제 2017. 8. 22. 이전 1 다음 728x90