Returns a Class
object which represents the component type if this class represents an array type. Returns null
if this class does not represent an array type. The component type of an array type is the type of the elements of the array.html
Returns the annotations that are directly defined on the class represented by this Class
. Annotations that are inherited are not included in the result. If there are no annotations at all, an empty array is returned.java
an array of annotations declared for this elementandroid
Returns an array containing all the annotations of this class. If there are no annotations then an empty array is returned.this
an array of all annotations for this elementspa
Returns an array containing Field
objects for all fields declared in the class represented by this Class
. If there are no fields or if thisClass
represents an array class, a primitive type or void then an empty array is returned.code
getFields()
component
Returns an array containing Field
objects for all public fields for the class C represented by this Class
. Fields may be declared in C, the interfaces it implements or in the superclasses of C. The elements in the returned array are in no particular order.htm
If there are no public fields or if this class represents an array class, a primitive type or void
then an empty array is returned.ci
Returns, for this element, all annotations that are explicitly declared (not inherited). If there are no declared annotations present, this method returns a zero length array.element
an array of annotations declared for this element
Indicates whether or not this field is synthetic.
true
if this field is synthetic, false
otherwise
Attempts to set the accessible flag. Setting this to true prevents IllegalAccessExceptions
IllegalAccessException:
Thrown when a program attempts to access a field or method which is not accessible from the location where the reference is made.