Partager via


Class.GetDeclaredFields Method

Definition

Returns an array of Field objects reflecting all the fields declared by the class or interface represented by this Class object.

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

Returns

Field[]

the array of Field objects representing all the declared fields of this class

Attributes

Remarks

Returns an array of Field objects reflecting all the fields declared by the class or interface represented by this Class object. This includes public, protected, default (package) access, and private fields, but excludes inherited fields.

If this Class object represents a class or interface with no declared fields, then this method returns an array of length 0.

If this Class object represents an array type, a primitive type, or void, then this method returns an array of 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.getDeclaredFields().

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