Java反射查看所有函数


import java.lang.reflect.Method;

public class DumpMethods {
    public static void main(String[] args)
    {
        try {
            Class classType = Class.forName(args[0]);
            Method[] methods = classType.getDeclaredMethods();
            for (Method method : methods){
                System.out.println(method.getName());
            }
        } catch (ClassNotFoundException e) {
            System.out.println("Not Find Class ");
//            e.printStackTrace();
        }
    }
}

执行java DumpMethods 完整的包路径 + 类名

你可能感兴趣的:(Java)