Yurttas/PL/OOL/CS/F/04/03/03/ABCD13.cs
Jump to navigation
Jump to search
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 ABCD13
16{
17 public static void Main(string[] args)
18 {
19 IA a0 = new D();
20
21 System.Console.WriteLine("a0 after instantiated -");
22 a0.PrintAll();
23
24 a0.I1 = 3;
25 a0.I2 = 1;
26 a0.I3 = 2;
27
28 System.Console.WriteLine("a0 after SetI1, I2, and I3 -");
29 a0.PrintAll();
30
31 System.Console.WriteLine("a0 after GetI1 - {0}",
32 a0.I1);
33 System.Console.WriteLine("a0 after GetI2 - {0}",
34 a0.I2);
35 System.Console.WriteLine("a0 after GetI3 - {0}",
36 a0.I3);
37
38 System.Console.WriteLine();
39
40 a0 = new B();
41
42 System.Console.WriteLine("a0 after instantiated -");
43 a0.PrintAll();
44
45 a0.I1 = 2;
46 a0.I2 = 7;
47 a0.I3 = 9;
48
49 System.Console.WriteLine("a0 after SetI1, I2, and I3 -");
50 a0.PrintAll();
51
52 B b0 = new B();
53
54 System.Console.WriteLine("b0 after instantiated -");
55 b0.PrintAll();
56
57 b0.I1 = 1;
58 b0.I2 = 3;
59 b0.I3 = 5;
60
61 System.Console.WriteLine("b0 after SetI1, I2, and I3 -");
62 b0.PrintAll();
63 }
64}