Yurttas/PL/OOL/CS/F/02/05/02/03/A.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
15import java.util.*;
16
17public class A {
18
19  private int[] a;
20
21  public A() {
22    a = new int[2];
23
24    a[0] = 0;
25    a[1] = 2;
26  }
27
28  public int getFirst() {
29    return a[0];
30  }
31
32  public int getLast() {
33    return a[1];
34  }
35
36  public int[] getA() {
37    return a;
38  }
39
40  public void setFirst(final int a) {
41    this.a[0] = a;
42  }
43
44  public void setLast(final int a) {
45    this.a[1] = a;
46  }
47
48  public void setA(final int a) {
49    this.a[0] = a;
50    this.a[1] = a;
51  }
52
53  public void setA(final int a,
54                   final int b) {
55    this.a[0] = a;
56    this.a[1] = b;
57  }
58
59  public void setA(final int[] a) {
60    this.a[0] = a[0];
61    this.a[1] = a[1];
62  }
63
64  public void printA() {
65    System.out.println("a /");
66
67    System.out.println("i0 = " + a[0]);
68    System.out.println("i1 = " + a[1]);
69
70    System.out.println();
71  }
72
73}