Class.GetDeclaredField(String) Method

Definition

Returns a Field object that reflects the specified declared field of the class or interface represented by this Class object.

[Android.Runtime.Register("getDeclaredField", "(Ljava/lang/String;)Ljava/lang/reflect/Field;", "")]
public Java.Lang.Reflect.Field GetDeclaredField (string name);
[<Android.Runtime.Register("getDeclaredField", "(Ljava/lang/String;)Ljava/lang/reflect/Field;", "")>]
member this.GetDeclaredField : string -> Java.Lang.Reflect.Field

Parameters

name
String

the name of the field

Returns

the Field object for the specified field in this class

Attributes

Exceptions

if the requested field can not be found.

Remarks

Returns a Field object that reflects the specified declared field of the class or interface represented by this Class object. The name parameter is a String that specifies the simple name of the desired field.

If this Class object represents an array type, then this method does not find the length field of the array type.

Added in 1.1.

Java documentation for java.lang.Class.getDeclaredField(java.lang.String).

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