共用方式為


Class.GetFields Method

Definition

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

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

Returns

Field[]

the array of Field objects representing the public fields

Attributes

Remarks

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

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

If this Class object represents a class, then this method returns the public fields of the class and of all its superclasses and superinterfaces.

If this Class object represents an interface, then this method returns the fields of the interface and of all its superinterfaces.

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.getFields().

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