Yurttas/PL/OOL/Java/F/04/01/10/03/ABCD02.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 ABCD02 {
 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
 34    System.out.println();
 35
 36    B b0 = new D();
 37
 38    System.out.println("b0 after instantiated -");
 39    b0.printAll();
 40
 41    b0.setI1(2);
 42    b0.setI2(7);
 43    b0.setI3(4);
 44
 45    System.out.println("b0 after setI1, I2, and I3 -");
 46    b0.printAll();
 47
 48    System.out.println("b0 after getI1 - " +
 49                       b0.getI1());
 50    System.out.println("b0 after getI2 - " +
 51                       b0.getI2());
 52    System.out.println("b0 after getI3 - " +
 53                       b0.getI3());
 54
 55    System.out.println();
 56
 57    C c0 = new D();
 58
 59    System.out.println("c0 after instantiated -");
 60    c0.printAll();
 61
 62    c0.setI1(8);
 63    c0.setI2(5);
 64    c0.setI3(9);
 65
 66    System.out.println("c0 after setI1, I2, and I3 -");
 67    c0.printAll();
 68
 69    System.out.println("c0 after getI1 - " +
 70                       c0.getI1());
 71    System.out.println("c0 after getI2 - " +
 72                       c0.getI2());
 73    System.out.println("c0 after getI3 - " +
 74                       c0.getI3());
 75
 76    System.out.println();
 77
 78    D d0 = new D();
 79
 80    System.out.println("d0 after instantiated -");
 81    d0.printAll();
 82
 83    d0.setI1(8);
 84    d0.setI2(7);
 85    d0.setI3(6);
 86    d0.setI4(2);
 87
 88    System.out.println("d0 after setI1, I2, I3, and I4 -");
 89    d0.printAll();
 90
 91    System.out.println("d0 after getI1 - " +
 92                       d0.getI1());
 93    System.out.println("d0 after getI2 - " +
 94                       d0.getI2());
 95    System.out.println("d0 after getI3 - " +
 96                       d0.getI3());
 97    System.out.println("d0 after getI4 - " +
 98                       d0.getI4());
 99
100  }
101
102}