alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 * ClassOne.java
 *
 * Created on 23 February 2004, 15:49
 */

package org.netbeans.test.rollback;

/**
 *
 * @author  Dan
 */
public class ClassOne {
    
    private static int instanceCounter = 0;
    static ClassOne defaultInstance = null;
    
    /** Creates a new instance of ClassOne */
    public ClassOne() {
        instanceCounter++;
    }
    
    public static void go() {
        System.out.println("started");
        for (int x = 0; x < 10; x++) {
            new ClassOne();
        }
        System.out.println("finished");
    }
    
    public static int getCounterValue() {
        return instanceCounter;
    }
    
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.