There are some environments that pick up a new version of a class in a running system such as JSPs,
JUnit and most
IDE debuggers. They do it by using a new ClassLoader for each new version. If one part of your program uses the system class loader to get an object and another part uses a custom loader to get the an object of the same class, they might wind up with different versions. The
doc says something about all instances of the old version have to be unreferenced and eligible for GC to do this, but I'm not entirely sure about that. It sounds scary but you can read the JUnit code and they make it look dead simple.
What is your objective, Dimple? I'm not sure if I'm on the right track at all.