Jump to content

Talk:Java class file

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dmeranda (talk | contribs) at 05:20, 23 October 2007 (Structure section needs a lot of work: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

//hello.java } class java

Structure section needs a lot of work

The structure sections need some work, it is incorrect as is. The "arrays", such as the constant pool, are not arrays in the typical sense (the entries are not all the same size), instead it is more like a stream. Thus the formulas calculating it's size are misleading at best; they don't compute the number of bytes used. Also they don't account for the strange fact that long and double types consume two slots (leaving a phantom unused slot behind) rather than one slot like all other types. It should also be mentioned that the JVM's UTF-8 string type is not quite standard UTF-8; it is a modified non-standard form. The C representation is also by no means able to "fully represent" the file structure as stated. First, one must assume big-endian layout, no padding bytes, and the use of IEEE 754 floating point storage format. And as mentioned the arrays are nothing like C arrays at all (they contain variable-width members), so that part is pseudo code at best. Also the structure shown is only the outermost layer; none of the dependent inner types are shown in the code (so it can not be a complete representation). The table is also just visually cluttered, I'm sure it could be cleaned up a lot. - Dmeranda 05:20, 23 October 2007 (UTC)[reply]