Yurttas/PL/OOL/Java/F/04/01/10/02/B.java

From ZCubes Wiki
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 B implements A {
16
17  private int i1,
18              i2;
19
20  public B() {
21    i1 = 0;
22    i2 = 0;
23  }
24
25  public B(final int i) {
26    i1 = i;
27    i2 = i;
28  }
29
30  public B(final int i,
31           final int j) {
32    i1 = i;
33    i2 = j;
34  }
35
36  public int getI1() {
37    return i1;
38  }
39
40  public int getI2() {
41    return i2;
42  }
43
44  public void setI1(final int i) {
45    i1 = i;
46  }
47
48  public void setI2(final int i) {
49    i2 = i;
50  }
51
52  public void printAll() {
53    System.out.println("i1 = " + i1);
54    System.out.println("i2 = " + i2);
55  }
56
57}