Yurttas/PL/OOL/Java/F/02/07/01/compa/CompA.java

From ZCubes Wiki
Jump to navigation Jump to search
 1/**
 2 *  Copyright(C) 2005
 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, 2005.
11 *  @author : Salih Yurttas
12 */
13
14
15package compa;
16
17import java.io.*;
18
19public class CompA implements ICompA {
20
21  public CompA() {
22  }
23
24  public void fOne(int inc)
25    throws IOException
26  {
27    String line = null;
28
29    BufferedReader is = new BufferedReader(new InputStreamReader(System.in));
30    System.out.print("-> a : ");
31    line = is.readLine();
32    int a = Integer.parseInt(line);
33
34    a += inc;
35
36    System.out.println("a = " + a);
37  }
38
39  public void fTwo(int inc)
40    throws IOException
41  {
42    String line = null;
43
44    BufferedReader is = new BufferedReader(new InputStreamReader(System.in));
45    System.out.print("-> b : ");
46    line = is.readLine();
47    int b = Integer.parseInt(line);
48
49    b += inc;
50
51    System.out.println("b = " + b);
52  }
53
54}