2012-01-28 21 views

答えて

3

あなたは、invoke(Instance of Object containing Method, 5, "foo")

3

あなたは、次のようにそれを行うことができます使用することができます。objは、あなたのクラスのインスタンスである

MyClass.class.getMethod(int.class, String.class).invoke(obj, 1, "hello")

。 メソッドが静的である場合はobjの代わりにnullを渡すことができます。

関連する問題