public static Object invokeStatic(Class clazz,String methodName,Class[] types,Object[] values) throws NoSuchMethodException {
  try {
    Method method=clazz.getMethod(methodName,types);
    Object result=method.invoke(null,values);
    return result;
  }
 catch (  IllegalAccessException e) {
    throw new NoSuchMethodException(methodName + " is not accessible");
  }
catch (  InvocationTargetException e) {
    throw new InternalError(e.getMessage());
  }
}

public static Object invokeStatic ( Class clazz , String methodName , Class [ ] types , Object [ ] values ) throws NoSuchMethodException { try { Method method = clazz . getMethod ( methodName , types ) ; Object result = method . invoke ( null , values ) ; return result ; } catch ( IllegalAccessException e ) { throw new NoSuchMethodException ( methodName + " is not accessible" ) ; } catch ( InvocationTargetException e ) { throw new InternalError ( e . getMessage ( ) ) ; } }
invokes the specified parameterless method if it exists .
