summaryrefslogtreecommitdiff
path: root/output/ex26.java
blob: f10d2fc3dcafc5f5c2e9fd1a3f0dab2a0082dd80 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
class StealMainArg {
    public static void main(String[] z) {
        A a ;
        B b ;
        C c ;
        a = new A() ;
        b = new B() ;
        c = new C() ;
        System.out.println(c.play_with_classes(a, b)) ;
    }
}

class A {

    public int get_tt() {
        return 32 ;
    }

}

class B extends A {

    int useless ;

}

class C {

    public int play_with_classes(A a, B b) {
        int ret ;
        int x ;
        int y ;
        x = a.get_tt() ;
        y = b.get_tt() ;
        ret = x + y ;
        return ret ;
    }
}