next up previous contents
Next: Fields in a Up: The Java Class Previous: The Java Class

The Class File Structure

A Java class file contains the following structure:

ClassFile
{
    u4                magic;
    u2                minor_version;
    u2                major_version;
    u2                constant_pool_count;
    cp_info           constant_pool[constant_pool_count-1];
    u2                access_flags;
    u2                this_class;
    u2                super_class;
    u2                interfaces_count;
    u2                interfaces[interface_count];
    u2                fields_count;
    field_info        fields[fields_count];
    u2                methods_count;
    method_info       methods[methods_count];
    u2                attributes_count;
    attribute_info    attributes[attributes_count];
}

The types u2 and u4 represent an unsigned two-, or four byte quantity, respectively. The fields of this structure are described in the next section.



mark@bottom.xs4all.nl