code: public static Object loadInstance(Class clazz, Object[] args) throws ClassException, InvocationTargetException {
  	if (args == null || args.length == 0) return loadInstance(clazz);
  
  	Class[] cArgs = new Class[args.length];
  	for (int i = 0; i < args.length; i++) {
  	    cArgs[i] = args[i].getClass();
  	}
  
  	try {
  	    Constructor c = clazz.getConstructor(cArgs);
  	    return c.newInstance(args);
  
  	}
  	catch (SecurityException e) {
  	    throw new ClassException("there is a security violation (throwed by security manager)");
  	}
  	catch (NoSuchMethodException e) {
  
  	    StringBuilder sb = new StringBuilder(clazz.getName());
  	    char del = '(';
  	    for (int i = 0; i < cArgs.length; i++) {
  		sb.append(del);
  		sb.append(cArgs[i].getName());
  		del = ',';
  	    }
  	    sb.append(')');
  
  	    throw new ClassException("there is no constructor with this [" + sb + "] signature for the class [" + clazz.getName() + "]");
  	}
  	catch (IllegalArgumentException e) {
  	    throw new ClassException("has been passed an illegal or inappropriate argument");
  	}
  	catch (InstantiationException e) {
  	    throw new ClassException("the specified class object [" + clazz.getName() + "] cannot be instantiated because it is an interface or is an abstract class");
  	}
  	catch (IllegalAccessException e) {
  	    throw new ClassException("can't load class because the currently executing method does not have access to the definition of the specified class");
  	}
      }
docs: loads a class from a String classname
  
  @param clazz class to load
  @param args
  @return matching Class
  @throws ClassException
  @throws ClassException
  @throws InvocationTargetException