01: package experiments;
02:
03: /**
04: * A static class.
05: *
06: * @author Tin
07: * @version $Revision: 92 $
08: */
09: public class StaticClass {
10:
11: private StaticClass() {
12: }
13:
14: public static int add(int a, int b) {
15: return a + b;
16: }
17:
18: public static int sum(int[] a) {
19: int sum = 0;
20: for (int i = 0; i < a.length; i++) {
21: sum += a[i];
22: }
23: return sum;
24: }
25: }
|