code: public static Object createObject(Class classObject, Object[] params) throws Exception {
  		Constructor[] constructors = classObject.getConstructors();
  		Object object = null;
  		for (int counter = 0; counter < constructors.length; counter++) {
  			try {
  				object = constructors[counter].newInstance(params);
  			} catch (Exception e) {
  				if (e instanceof InvocationTargetException)
  					((InvocationTargetException) e).getTargetException().printStackTrace();
  				// do nothing, try the next constructor
  			}
  		}
  		if (object == null)
  			throw new InstantiationException();
  		return object;
  	}
docs: Instantaite an Object instance, requires a constractor with parameters
  
  @param classObject
  , Class object representing the object type to be instantiated
  @param params
  an array including the required parameters to instantaite the
  object
  @return the instantaied Object
  @exception java.lang.Exception
  if instantiation failed