This is the class:
class Foo { public void bar(int a, Object b) { } }
Now I'm trying to "flip" this method from the class:
Class c = Foo.class; Class[] types = { ... }; // what should be here? Method m = c.getMethod("bar", types);
Only int.class .
int.class
Class[] types = { int.class, Object.class };
An alternative is Integer.TYPE .
Integer.TYPE
Class[] types = { Integer.TYPE, Object.class };
The same applies to other primitives.