summaryrefslogtreecommitdiff
path: root/output/ex22.java
blob: 6163dec79d4fa870ec0f264502c8bcf8c4df84fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class Overriding {
    public static void main(String[] args) {
        System.out.println(new A().init());
    }
}

class A {
    boolean x ;

    public int init() {
        return 0;
    }

    public int x(A a) {
        return 1;
    }
}

class B extends A {
    int x;
    public int x(A a) {
        x = 2 ;
        return x ;
    }
}