아래 코드의 출력값을 작성하시오.
class Parent {
static int total = 0;
int v = 1;
public Parent() {
total += (++v); show();
}
public void show() {
total += total;
}
}
class Child extends Parent {
int v = 10;
public Child() {
v += 2; total += v++; show();
}
@Override
public void show() {
total += total * 2;
}
}
public class Main {
public static void main(String[] args) {
new Child();
System.out.println(Parent.total);
}
}이 문제는 풀이 화면에서 직접 실행해 풀 수 있어요.
꿈라CBT