Yurttas/PL/OOL/Java/F/04/03/10/12/PQ00.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 PQ00 {
16
17  public static void main(String[] args) {
18
19    P p1 = new P();
20
21    System.out.println("initial values after default construction -P() /");
22
23    p1.output();
24
25    System.out.println();
26
27    p1.setI1(2);
28
29    System.out.println("accessor after mutator /");
30    System.out.println(p1.getI1());
31
32    System.out.println();
33
34    P p2 = new P(9);
35
36    System.out.println("initial values after default construction -P() /");
37
38    p2.output();
39
40    System.out.println();
41
42    p2.setI1(3);
43
44    System.out.println("accessor after mutator /");
45    System.out.println(p2.getI1());
46
47    System.out.println();
48    System.out.println();
49
50    Q q1 = new Q();
51
52    System.out.println("initial values after default construction -Q() /");
53
54    q1.output();
55
56    System.out.println();
57
58    q1.setI1(2);
59    q1.setI1(7);
60
61    System.out.println("accessor after mutator /");
62    System.out.println(q1.getI1());
63    System.out.println(q1.getI2());
64
65    System.out.println();
66
67    Q q2 = new Q(9);
68
69    System.out.println("initial values after default construction -Q() /");
70
71    q2.output();
72
73    System.out.println();
74
75    q2.setI1(3);
76    q2.setI2(8);
77
78    System.out.println("accessor after mutator /");
79    System.out.println(q2.getI1());
80    System.out.println(q2.getI2());
81
82  }
83
84}