Quire

Fail kelas Java

From Quire, the open reference··1 min read

Fail kelas Java ialah sebuah fail dengan sambungan fail .class mengandungi kod bait Java yang boleh dilakukan pada mesin maya Java (JVM).

Susun atur umum#edit

ofset baitsaizjenis atau nilaipenerangan
04 bytesu1 =
0xCA hex
angka ajaib (CAFEBABE) bagi menentukan fail mengikut format fail kelas
1u1 =
0xFE hex
2u1 =
0xBA hex
3u1 =
0xBE hex
42 baitu2nombor versi minor bagi format fail kelas yang dipakai
5
62 baitu2nombor versi major bagi format fail kelas yang dipakai.

Java SE 13 = 57 (0x39 hex),
Java SE 12 = 56 (0x38 hex),
Java SE 11 = 55 (0x37 hex),
Java SE 10 = 54 (0x36 hex),[1]
Java SE 9 = 53 (0x35 hex),[2]
Java SE 8 = 52 (0x34 hex),
Java SE 7 = 51 (0x33 hex),
Java SE 6.0 = 50 (0x32 hex),
Java SE 5.0 = 49 (0x31 hex),
JDK 1.4 = 48 (0x30 hex),
JDK 1.3 = 47 (0x2F hex),
JDK 1.2 = 46 (0x2E hex),
JDK 1.1 = 45 (0x2D hex).
Maklumat nombor-nombor versi yang lebih awal tercata di nota kaki 1 di The JavaTM Virtual Machine Specification 2nd edition
7
82 baitu2bilangan constant pool, bilangan entri dalam jadual constant pool berikut. This count is at least one greater than the actual number of entries; see following discussion.
9
10cpsize (variable)tableconstant pool table, an array of variable-sized constant pool entries, containing items such as literal numbers, strings, and references to classes or methods. Indexed starting at 1, containing (constant pool count - 1) number of entries in total (see note).
...
...
...
10+cpsize2 bytesu2access flags, a bitmask
11+cpsize
12+cpsize2 bytesu2identifies this class, index into the constant pool to a "Class"-type entry
13+cpsize
14+cpsize2 bytesu2identifies super class, index into the constant pool to a "Class"-type entry
15+cpsize
16+cpsize2 bytesu2interface count, number of entries in the following interface table
17+cpsize
18+cpsizeisize (variable)tableinterface table: a variable-length array of constant pool indexes describing the interfaces implemented by this class
...
...
...
18+cpsize+isize2 bytesu2field count, number of entries in the following field table
19+cpsize+isize
20+cpsize+isizefsize (variable)tablefield table, variable length array of fields
each element is a field_info structure defined in https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.5
...
...
...
20+cpsize+isize+fsize2 bytesu2method count, number of entries in the following method table
21+cpsize+isize+fsize
22+cpsize+isize+fsizemsize (variable)tablemethod table, variable length array of methods
each element is a method_info structure defined in https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6
...
...
...
22+cpsize+isize+fsize+msize2 bytesu2attribute count, number of entries in the following attribute table
23+cpsize+isize+fsize+msize
24+cpsize+isize+fsize+msizeasize (variable)tableattribute table, variable length array of attributes
each element is an attribute_info structure defined in https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7
...
...
...

Jika anda melihat rencana yang menggunakan templat {{tunas}} ini, gantikanlah dengan templat tunas yang lebih spesifik.

  1. ^ http://www.oracle.com/technetwork/java/javase/10-relnote-issues-4108729.html#Remaining
  2. ^ https://bugs.openjdk.java.net/browse/JDK-8148785

This article is mirrored from “Fail kelas Java” on Bahasa Melayu Wikipedia, revision 4551268, written by Wikipedia's contributors and licensed CC BY-SA 4.0. Editing it here creates a Quire copy with its own history.

Synced with Wikipedia revision 4551268 · just now