@CallerSensitive
public Field[] getFields () throws SecurityException

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.

Returns:  the array of Field objects representing the public fields

Exceptions:
SecurityException     If a security manager, s, is present and the caller's class loader is not the same as or an ancestor of the class loader for the current class and invocation of s.checkPackageAccess() denies access to the package of this class.

Since:  1.1

@jls 8.2 Class Members
@jls 8.3 Field Declarations