은닉성
[JAVA] #OOP특성 #상속 #다형 #은닉 #캡슐화 #캐스팅 #오버라이딩
class Mother{ String name; Mother(String name){ this.name = name; } void action() { System.out.println("cooking"); } } class Son extends Mother{ Son() { super("아들"); System.out.println("new Son: "+name); } /*void action() { System.out.print("Son action overriding: "); System.out.println("Soccer play"); } */ } class Daughter extends Mother{ Daughter() { super("딸"); System.out.println("new Daughte..