프로그래밍 언어 활용난도 중상
16번 · 주관식 · 5점
다음 Java 프로그램의 실행 결과를 쓰시오.
class A {
int a;
private int b;
protected int c;
A(int a, int b, int c) {
this.a = a;
this.b = b;
this.c = c;
}
int func() {
return a + b + c;
}
}
class B extends A {
B(int a, int b, int c) {
super(a, b, c);
}
@Override
public int func() {
return a * c;
}
}
public class Main {
public static void main(String[] args) {
A a = new A(1, 5, 3);
B b = new B(10, 30, 50);
System.out.print(a.func() + b.func());
}
}