Contents Prev Next Up

## Class File Format

# Signatures

A signature is a string representing the type of a method or field.

The field signature represents the value of an argument to a function or the value of a variable. It is a series of bytes in the following grammar:

    <field signature>	:=	<field_type>
    <field type>	:=	<base_type>|<object_type>|<array_type>
    <base_type>	:=	B|C|D|F|I|J|S|Z
    <object_type>	:=	L<fullclassname>;
    <array_type>	:=	[<optional-size><field_type>
    <optional_size>	:=	[0-9]*

The meaning of the base types is as follows:

    	B			signed byte
    	C			character
    	D			double precision floating point number
    	F			single precision floating point number
    	I			integer
    	J			long integer
    	L<fullclassname>;			an object of the given class
    	S			nsigned short
    	Z			boolean
    	[<length><field sig>			array

A return-type signature represents the return value from a method. It is a series of bytes in the following grammar:

    <return signature>	:=	<field type> | V

The character V indicates that the method returns no value. Otherwise, the signature indicates the type of the return value.

An argument signature represents an argument passed to a method:

    <argument signature>	:=	<field type>

A method signature represents the arguments that the method expects, and the value that it returns.

    <method_signature>	:=	(<arguments signature>) <return signature>
    <arguments signature>	:=	<argument signature>*

Contents Prev Next Up

Generated with CERN WebMaker