如何在Java中引用Method对象?

Ale*_*der 0 java reflection methods

或者,换句话说,有什么问题 - 例如 -

new Method[] {Vector.add(), Vector.remove()}
Run Code Online (Sandbox Code Playgroud)

Eclipse一直告诉我,我需要参数.但我显然不想调用这些方法,我只是想用它们作为对象!该怎么办?

All*_*nde 6

这项工作,我不禁想知道,你在做什么?

new Method[] { 
  Vector.class.getMethod("add", Object.class), 
  Vector.class.getMethod("remove", Object.class) 
};
Run Code Online (Sandbox Code Playgroud)