01: package test.dynamic;
02:
03: /** Simple class with some static initialization that can be observed without
04: * actually operating on any of the class's interface.
05: */
06: public class ComponentClassForLoading extends java.awt.Component {
07: private static int instanceCount = 0;
08:
09: public ComponentClassForLoading() {
10: synchronized (getClass()) {
11: ++instanceCount;
12: }
13: }
14:
15: public String toString() {
16: synchronized (getClass()) {
17: return String.valueOf(instanceCount);
18: }
19: }
20: }
|