Yurttas/PL/OOL/Java/F/02/06/01/AA01.java

From ZCubes Wiki
Jump to navigation Jump to search
 1/**
 2 *  Copyright(C) 1998
 3 *  All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4 *
 5 *  Permission to use, copy, modify, and distribute this
 6 *  software and its documentation for EDUCATIONAL purposes
 7 *  and without fee is hereby granted provided that this
 8 *  copyright notice appears in all copies.
 9 *
10 *  @date   : January 1, 1998.
11 *  @author : Salih Yurttas.
12 */
13
14
15public class AA01 {
16
17  private int i0;
18
19  public static void main(String[] args) {
20
21    AA01 aa01 = new AA01();
22
23    System.out.println(aa01.ma1());
24
25    aa01.ma2();
26    System.out.println(aa01.ma1());
27
28  }
29
30  public class IAA extends AA {
31    public void m1(final int i) {
32      i0 = i;
33    }
34  }
35
36  public AA01() {
37    IAA iaa = new IAA();
38    iaa.m1(2);
39  }
40
41  public int ma1() {
42    return i0;
43  }
44
45  public int ma2() {
46    IAA iaa = new IAA();
47    iaa.m1(4);
48    return i0;
49  }
50
51}