  java class file is a file (with the .class filename extension) containing a java bytecode which can be executed on the java virtual machine (jvm). java class file is produced by java compiler from java programming language source files (.java files) containing java classes. if a source file has more than one class, each class is compiled into a separate class file. jvms are available for many platforms, and the class file compiled in one platform will execute in a jvm of another platform. this makes java platform-independent. ==history== on 11 december 2006, the class file format was modified under java specification request (jsr) 202.jsr 202 java class file specification update ==file layout and structure== ===sections=== there are 10 basic sections to the java class file structure: * magic number: 0xcafebabe * version of class file format: the minor and major versions of the class file * constant pool: pool of constants for the class * access flags: for example whether the class is abstract, static, etc. * this class: the name of the current class * super class: the name of the super class * interfaces: any interfaces in the class * fields: any fields in the class * methods: any methods in the class * attributes: any attributes of the class (for example the name of the sourcefile, etc.) ===magic number=== class files are identified by the following 4 byte header (in hexadecimal): ca fe ba be (the first 4 entries in the table below). the history of this magic number was explained by james gosling:james gosling private communication to bill bumgarner "we used to go to lunch at a place called st michael's alley. according to local legend, in the deep dark past, the grateful dead used to perform there before they made it big. it was a pretty funky place that was definitely a grateful dead kinda place. when jerry died, they even put up a little buddhist-esque shrine. when we used to go there, we referred to the place as cafe dead. somewhere along the line it was noticed that this was a hex number. i was re-va
Computer_file_formats Java_platform