Java SE/Virtual Method 썸네일형 리스트형 Virtual Method Invocation 가상메소드 호출의 예 부모 클래스 class ShapeBase { int height; int width; ShapeBase(int height, int width) { this.height = height; this.width = width; } public double getArea() { return 0.0; } } class Triangle extends ShapeBase { public Triangle(int height, int width) { super(height, width); } public double getArea() { return height*width/2.0; } } class Rect extends ShapeBase { public Rect(int height, int wid.. 더보기 이전 1 다음