Content deleted Content added
Not0nshoree (talk | contribs) |
→Representation in a C-like programming language: use more Java-like layout |
||
(One intermediate revision by one other user not shown) | |||
Line 34:
===Sections===
There are 10 basic sections to the Java class file structure:
* '''[[Magic number (programming)|Magic Number]]''': <code>0xCAFEBABE</code>
* '''Version of Class File Format''': the minor and major versions of the class file
* '''Constant Pool''': Pool of constants for the class
Line 232:
|}
===Representation
The following is a representation of a {{mono|.class}} file as if it were a C-style struct.
<syntaxhighlight lang="
struct
u4
u2
u2
u2
ConstantPoolInfo[constantPoolCount - 1] constantPool;
u2
u2
u2
u2
u2[interfacesCount] interfaces;
u2
FieldInfo[fieldsCount] fields;
u2
MethodInfo[methodsCount] methods;
u2
AttributeInfo[attributesCount] attributes;
}
</syntaxhighlight>
|