Yurttas/PL/OOL/CS/F/03/00/05/A.cs
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 withConsole 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
15public class A
16{
17 public int i0;
18 protected int i1;
19 private int i2;
20
21 public A()
22 {
23 i0 = 2;
24 i1 = 2;
25 i2 = 2;
26 }
27
28 public A(int i)
29 {
30 i0 = i;
31 i1 = i;
32 i2 = i;
33 }
34
35 public A(int i,
36 int j,
37 int k)
38 {
39 i0 = i;
40 i1 = j;
41 i2 = k;
42 }
43
44 public int GetI1()
45 {
46 return i1;
47 }
48
49 public int GetI2()
50 {
51 return i2;
52 }
53
54 public int[] GetI12()
55 {
56 int[] a = new int[2];
57
58 a[0] = i1;
59 a[1] = i2;
60
61 return a;
62 }
63
64 public int[] GetI012()
65 {
66 int[] a = new int[3];
67
68 a[0] = i0;
69 a[1] = i1;
70 a[2] = i2;
71
72 return a;
73 }
74
75 public void SetI1(int i)
76 {
77 i1 = i;
78 }
79
80 public void SetI2(int i)
81 {
82 i2 = i;
83 }
84
85 public void SetI12(int i)
86 {
87 i1 = i;
88 i2 = i;
89 }
90
91 public void SetI12(int i,
92 int j)
93 {
94 i1 = i;
95 i2 = j;
96 }
97
98 public void SetI12(int[] a)
99 {
100 i1 = a[0];
101 i2 = a[1];
102 }
103
104 public void OutI012()
105 {
106 System.Console.WriteLine("i0 = {0}", i0);
107 System.Console.WriteLine("i1 = {0}", i1);
108 System.Console.WriteLine("i2 = {0}", i2);
109 }
110}