Here you can find the source of invokeStaticMethod(String className, String methodName, Object[] args)
public static Object invokeStaticMethod(String className, String methodName, Object[] args) throws Exception
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; public class Main { public static Object invokeStaticMethod(String className, String methodName, Object[] args) throws Exception { Class ownerClass = Class.forName(className); Class[] argsClass = new Class[args.length]; for (int i = 0, j = args.length; i < j; i++) { argsClass[i] = args[i].getClass(); }/* ww w .j a v a2 s. co m*/ Method method = ownerClass.getMethod(methodName, argsClass); return method.invoke(null, args); } }