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 methods.
05: */
06: public class ClassForReloading {
07: private static int instanceCount = 0;
08:
09: public ClassForReloading() {
10: synchronized (getClass()) {
11: ++instanceCount;
12: }
13: }
14:
15: public String toString() {
16: return String.valueOf(instanceCount);
17: }
18:
19: public static void main(String[] args) {
20: //System.out.println("Main routine of dynamically loaded class");
21: }
22: }
|