Returns a Method
object that reflects the specified
declared method of the class or interface represented by this
Class
object. The name
parameter is a
String
that specifies the simple name of the desired
method, and the parameterTypes
parameter is an array of
Class
objects that identify the method's formal parameter
types, in declared order. If more than one method with the same
parameter types is declared in a class, and one of these methods has a
return type that is more specific than any of the others, that method is
returned; otherwise one of the methods is chosen arbitrarily. If the
name is "<init>"or "<clinit>" a NoSuchMethodException
is raised.
If this Class
object represents an array type, then this
method does not find the clone()
method.
name | the name of the method | |
parameterTypes | the parameter array |
Method
object for the method of this class
matching the specified name and parameters
NoSuchMethodException | if a matching method is not found. | |
NullPointerException | if name is null | |
SecurityException
| If a security manager, s, is present and any of the
following conditions is met:
|
@jls 8.2 Class Members
@jls 8.4 Method Declarations
Diagram: Class, Package, Module