KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > test > rollback > ClassOne


1 /*
2  * ClassOne.java
3  *
4  * Created on 23 February 2004, 15:49
5  */

6
7 package org.netbeans.test.rollback;
8
9 /**
10  *
11  * @author Dan
12  */

13 public class ClassOne {
14     
15     private static int instanceCounter = 0;
16     static ClassOne defaultInstance = null;
17     
18     /** Creates a new instance of ClassOne */
19     public ClassOne() {
20         instanceCounter++;
21     }
22     
23     public static void go() {
24         System.out.println("started");
25         for (int x = 0; x < 10; x++) {
26             new ClassOne();
27         }
28         System.out.println("finished");
29     }
30     
31     public static int getCounterValue() {
32         return instanceCounter;
33     }
34     
35 }
36
Popular Tags