Java type Representation

Source: Internet
Author: User

The prefix of the bytecode enable.

Type code example
Description
Byte B
Baload loads byte type from Array
Short s
Sastore saves the short type to the array
Int I iload_1
Load int type from local variable 1
Long L
Lcmp compares long type values
Char C
I2C converts int type data to char type
Float F
Fload loads the float type from a local variable
Double D
Dconst_1 pushes the double type constant 1.0 to the stack
Reference
Aaload loads reference types from Arrays
Storage and computing types in Java virtual machines

Minimum bit number in the storage type heap or Method Area
Word Length in computing java stack Frames
Byte 8
Int 1
Short 16
Int 1
Int 32
Int 1
Long 64
Long 2
Char 16
Int 1
Float 32
Float 1
Double 64
Double 2
Reference 32
Reference 1
Terminator of the basic type (this is close to the method signature)

Terminator type
B byte
C char
D double
F float
I int
J long
S short
Z Boolean
If the terminator of Boolean is not B, bytes are occupied. If the terminator of long Is Not l, the object Terminator is occupied. If the return value is void, the Terminator is V, the object type Terminator is L and, and the array type Terminator is [

Field descriptor example

Descriptor field Declaration
I int I
[[J long [] [] windingroad
[Ljava/lang/object; object [] stuff
Ljava/util. hashtable; Java. util. hashtable HT
[[Z Boolean [] [] [] isready
Method descriptor example

Descriptor method declaration
() I int getsize ()
() Ljava/lang/string; string tostring ()
([Ljava/lang/string;) V void main (string [] ARGs)
() V void wait ()
(JI) V void wait (long timeout, int Nanos)
(Z [ljava/lang/string; ii) Z Boolean regionmatches (Boolean ignorecase, int tooffset, string other, in oooffset, int Len
([Bii) I int read (byte [] B, int off, int Len)
Execute javap-s java. util. date to check the signatures of all java. util. Date methods. The following is a piece:

C: \ Documents ents and Settings \ Administrator> javap-s java. util. Date
Compiled from "date. Java"
Public class java. util. Date extends java. Lang. Object implements Java ............
Public java. util. Date ();
Signature: () V
Public java. util. Date (long );
Signature: (j) V
Public java. util. Date (INT, Int, INT );
Signature: (iii) V
Public java. util. Date (INT, Int, INT );
Signature: (iiiii) V
Public java. util. Date (INT, Int, INT );
Signature: (iiiiii) V
Public java. util. Date (Java. Lang. String );
Signature: (ljava/lang/string;) V
Public java. Lang. Object clone ();
Signature: () ljava/lang/object;
Public static long UTC (INT, Int, INT );
Signature: (iiiiii) j
Public static long parse (Java. Lang. String );
Signature: (ljava/lang/string;) j
Public int getyear ();

The data in the table comes from deep Java Virtual Machine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.