code: public static Object loadInstance(Class clazz, Object[] args, Object defaultValue) {
  	if (args == null || args.length == 0) return loadInstance(clazz, defaultValue);
  	try {
  	    Class[] cArgs = new Class[args.length];
  	    for (int i = 0; i < args.length; i++) {
  		if (args[i] == null) cArgs[i] = Object.class;
  		else cArgs[i] = args[i].getClass();
  	    }
  	    Constructor c = clazz.getConstructor(cArgs);
  	    return c.newInstance(args);
  
  	}
  	catch (Throwable t) {
  	    ExceptionUtil.rethrowIfNecessary(t);
  	    return defaultValue;
  	}
  
      }
docs: loads a class from a String classname
  
  @param clazz class to load
  @param args
  @return matching Class