Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Singleton {
- private static Singleton instance;
- // other code, construct, getters, no matter
- }
- Singleton singleton = Singleton.getInstance();
- singleton = null;
- private static Class getClass(String classname) throws ClassNotFoundException {
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- if(classLoader == null)
- classLoader = Singleton.class.getClassLoader();
- return (classLoader.loadClass(classname));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement