Yurttas/PL/OOL/CS/F/02/05/02/01/A.cs

From ZCubes Wiki
Jump to navigation Jump to search
 1/**
 2 *  Copyright(C) 2003
 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   : September 1, 2003.
11 *  author : Salih Yurttas.
12 *
13 */
14
15
16using System;
17
18namespace A
19{
20
21  public class A
22  {
23    private int i0;
24
25    private int i1;
26
27    private int[] i0i1 = new int[2];
28
29    public A()
30    {
31      i0 = 0;
32      i1 = 2;
33    }
34
35    public int I0
36    {
37      get
38      {
39        return i0;
40      }
41      set
42      {
43        i0 = value;
44      }
45    }
46
47    public int I1
48    {
49      get
50      {
51        return i1;
52      }
53      set
54      {
55        i1 = value;
56      }
57    }
58
59    public int[] I0I1
60    {
61      get
62      {
63        i0i1[0] = i0;
64        i0i1[1] = i1;
65
66        return i0i1;
67      }
68      set
69      {
70        i0i1[0] = value;
71        i0i1[1] = value;
72      }
73    }
74
75    public void PrintA()
76    {
77      Console.WriteLine("A /");
78
79      Console.WriteLine("i0 = {0}", i0);
80      Console.WriteLine("i1 = {0}", i1);
81
82      Console.WriteLine();
83    }
84  }
85
86}