java - How to use getMethod() with primitive types? -
this class:
class foo { public void bar(int a, object b) { } } now i'm trying "reflect" method class:
class c = foo.class; class[] types = { ... }; // should here? method m = c.getmethod("bar", types);
there's int.class.
class[] types = { int.class, object.class }; an alternative integer.type.
class[] types = { integer.type, object.class }; the same applies on other primitives.
Comments
Post a Comment