Let's say I have a method do expecting an array of arguments of some class E:
public class D {
public void do(E ..arg){}
}
public static void main(String[] args) {
Class z = Class.forName("D");
Class e = Class.forName("E");
Method m = z.getDeclaredMethod("do", e);
}
I want to get the method and the class using reflection, but this throws a
java.lang.NoSuchMethodException
doand a single parameter of typeE. But the method has aE[]parameter...doand varargs with..instead of...e, because that's not what the method expects.