Hi again, I know I've asked a lot of questions, and you guys have been a really big help, so sorry for all the trouble. XD But, I've got another problem. :X I've been making a reflective program, and it's more or less working right now except of couple of casting/wrapping problems.
My program keeps crashing whenever I try to run a reflective method using anything other then Strings. When I do a small test using a method that requires integers, I get the following error:
java.lang.NoSuchMethodException: Example.intint(java.lang.Integer, java.lang.Integer)
Below is my test class Example:
public class Example {
public static void output() {
System.out.println("Running output");
}
[B] public int intint(int var1, int var2) {
return (var1 + var2);[/B]
}
public String stringint(String x, int y) {
System.out.println(x);
System.out.println(y);
return null;
}
public String stringstring (String x, String y) {
return x.concat(y);
}
}
What I don't get is that I have an intint method that requires 2 int variables. How come my program can't seem to catch it? I'm currently using Integer.class; as my way of using intst as the class parameter, and String.class for Strings. Does anyone the proper way I should cast/wrap it?