-
상속 extendsJAVA 2020. 5. 6. 18:45
package test01; public class Test03 extends Test { public void setName44(String name) { System.out.println(name); } public static void main(String[] args) { Test03 test = new Test03(); Test test2 = new Test03(); //Test03 test3 = new Test(); //error 자식클래스변수는 부모클래스를 불러올수 없다 //부모상속 클래스에 자식 클래스를 인스턴스할수잇다 } }