public Field getDeclaredField (String name) throws NoSuchFieldException, SecurityException

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.

name    the name of the field

Returns:  the Field object for the specified field in this class

NoSuchFieldException    if a field with the specified name is not found.
NullPointerException    if name is null
SecurityException     If a security manager, s, is present and any of the following conditions is met:
  • the caller's class loader is not the same as the class loader of this class and invocation of s.checkPermission method with RuntimePermission("accessDeclaredMembers") denies access to the declared field
  • 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