01: /*
02: * SumNmbers.java
03: *
04: * Created on 07 January 2005, 14:48
05: */
06:
07: package org.netbeans.test.freeformlib;
08:
09: /**
10: *
11: * @author Administrator
12: */
13: public class SumNumbers {
14:
15: private int x = 0;
16: private int y = 0;
17:
18: /** Creates a new instance of SumNmbers */
19: public SumNumbers() {
20: }
21:
22: /** Creates a new instance of SumNmbers */
23: public SumNumbers(int x, int y) {
24: this .x = x;
25: this .y = y;
26: }
27:
28: /**
29: * Count the sum from parameters.
30: * @param x first argument for sum.
31: * @param y second argument for sum.
32: */
33: public static int sum(int x, int y) {
34: return x + y;
35: }
36:
37: /**
38: * Count the sum from initialized variables of object.
39: */
40: public int getSum() {
41: return x + y;
42: }
43:
44: public int getX() {
45: return x;
46: }
47:
48: public void setX(int x) {
49: this .x = x;
50: }
51:
52: public int getY() {
53: return x;
54: }
55:
56: public void setY(int y) {
57: this.y = y;
58: }
59: }
|