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

class A {
    public int init() {
        return 0;
    }

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

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