Yurttas/PL/OOL/Java/F/04/01/10/03/ABCD12.java

 1/**
 2 *  Copyright(C) 2004
 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, 2004.
11 *  @authorĀ : Salih Yurttas.
12 */
13
14
15public class ABCD12 {
16
17  public static void main(String[] args) {
18
19    A a0 = new D();
20
21    System.out.println("a0 after instantiated -");
22    a0.printAll();
23
24    a0.setI1(3);
25    a0.setI2(1);
26    a0.setI3(2);
27
28    System.out.println("a0 after setI1, I2, and I3 -");
29    a0.printAll();
30
31    System.out.println("a0 after getI1 - " +
32                       a0.getI1());
33    System.out.println("a0 after getI2 - " +
34                       a0.getI2());
35    System.out.println("a0 after getI3 - " +
36                       a0.getI3());
37
38    System.out.println();
39
40    a0 = new B();
41
42    System.out.println("a0 after instantiated -");
43    a0.printAll();
44
45    a0.setI1(2);
46    a0.setI2(7);
47    a0.setI3(9);
48
49    System.out.println("a0 after setI1, I2, and I3 -");
50    a0.printAll();
51
52    System.out.println();
53
54    B b0 = new B();
55
56    System.out.println("b0 after instantiated -");
57    b0.printAll();
58
59    b0.setI1(2);
60    b0.setI2(7);
61    b0.setI3(9);
62
63    System.out.println("b0 after setI1, I2, and I3 -");
64    b0.printAll();
65
66  }
67
68}