Udostępnij za pośrednictwem


Class.GetDeclaredMethods Method

Definition

Returns an array containing Method objects reflecting all the declared methods of the class or interface represented by this Class object, including public, protected, default (package) access, and private methods, but excluding inherited methods.

[Android.Runtime.Register("getDeclaredMethods", "()[Ljava/lang/reflect/Method;", "")]
public Java.Lang.Reflect.Method[] GetDeclaredMethods ();
[<Android.Runtime.Register("getDeclaredMethods", "()[Ljava/lang/reflect/Method;", "")>]
member this.GetDeclaredMethods : unit -> Java.Lang.Reflect.Method[]

Returns

Method[]

the array of Method objects representing all the declared methods of this class

Attributes

Remarks

Returns an array containing Method objects reflecting all the declared methods of the class or interface represented by this Class object, including public, protected, default (package) access, and private methods, but excluding inherited methods.

If this Class object represents a type that has multiple declared methods with the same name and parameter types, but different return types, then the returned array has a Method object for each such method.

If this Class object represents a type that has a class initialization method <clinit>, then the returned array does <em>not</em> have a corresponding Method object.

If this Class object represents a class or interface with no declared methods, then the returned array has length 0.

If this Class object represents an array type, a primitive type, or void, then the returned array has length 0.

The elements in the returned array are not sorted and are not in any particular order.

Added in 1.1.

Java documentation for java.lang.Class.getDeclaredMethods().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also