• 코드:
​x
 
1
class Parent {
2
    int a = 10;
3
}
4
​
5
class Child extends Parent {
6
    int a = 20;
7
    
8
    void display() {
9
        System.out.println(a);
10
        System.out.println(this.a);
11
        System.out.println(super.a);
12
    }
13
}
14
​
15
public class prog {
16
    public static void main(String[] args) {
17
        Child ch = new Child();
18
        ch.display();
19
    }
20
}
표준입력 & 실행옵션