jDK1.8的修改,在JDK8中,反射可以得到方法参数名了。是因为Method类加了新的方法
public Parameter[] getParameters()
但是实际项目中得到的确是arg0这样的参数名。请看下面代码:
public static void main(String[] args) throws NoSuchMethodException {
final Method method = Cat.class.getMethod("say", String.