summaryrefslogtreecommitdiff
path: root/output/ex50.java
blob: 576af0ecf97c80353a1a6b5aa4c592403bd8db4f (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
class ex50 {
    public static void main(String[] z) {
        int result ;
        A a ;
        a = new A() ;
        System.out.println(a.set_get()) ;
    }
}

class A {

    B b ;

    public int set_get() {
        int r ;
        b = new B() ;
        r = b.set() ;
        r = b.get() ;
        return r ;
    }
}

class B {

    int x ;

    public int get() {
        return x ;
    }

    public int set() {
        x = 12 ;
        return 1 ;
    }
}