Just a quick question.
No rush to answer, it is not important, I might discover it later myself, but just in case someone knows it:
I have been trying to create a Method object using this method:
Class.getMethod(String name, Class<?>... parameterTypes)
like this:
obj.getClass().getMethod(methodName, Class.forName(methodType))
My problem is that the method takes as argument an int:
public void setA(int a) { ... }
So when I call this:
Class.forName("int") I get an exception:
java.lang.ClassNotFoundException: int
But when I call it like this:
Class.forName("java.lang.Integer") I get an exception:
java.lang.NoSuchMethodException: pack.ClassR.setA(java.lang.Integer)
Is there a way to fix this other than changing the signature of the method?