next up previous contents
Next: Method Descriptors Up: Descriptors Previous: Descriptors

Field Descriptors

Field Descriptors are used to represent the type of a class or instance variable. They are constructed using the following grammar:

FieldDescriptor: FieldType

FieldType: BaseType | ObjectType | ArrayType

BaseType: B | C | D | F | I | J | S | Z

ObjectType: L<classname>;

ArrayType: [ ComponentType

ComponentType: FieldType

The <classname> represents a fully qualified class name in modified internal form. This means that all periods (`.') are replaced by forward slashes (` /'). For example the fully qualified name java.lang.Object is replaced by java/lang/Object.

The following table shows the field types and their meaning:

For example, the descriptor of a field of type boolean is Z. The descriptor of a field of type String is Ljava/lang/String;. The descriptor of a field that is a four dimensional int array is [[[[I.



mark@bottom.xs4all.nl