Chinaunix首页 | 论坛 | 博客
  • 博客访问: 160857
  • 博文数量: 56
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 593
  • 用 户 组: 普通用户
  • 注册时间: 2014-02-18 09:59
文章分类

全部博文(56)

文章存档

2019年(1)

2018年(26)

2016年(1)

2015年(6)

2014年(22)

我的朋友

分类: Java

2014-02-18 10:28:55


   原文链接:

    下表给出了常量池中11种数据类型的结构:

 

常量

项目

类型

描述

 

CONSTANT_Utf8_info

tag

u1

值为1

length

u2

UF-8编码的字符串占用的字节数

bytes

u1

长度为length的UTF-8编码的字符串

 

CONSTANT_Integer_info

tag

u1

值为3

bytes

u4

按照高位在前存储的int值

 

CONSTANT_Float_info

tag

u1

值为4

bytes

u4

按照高位在前存储的float值

 

CONSTANT_Long_info

tag

u1

值为5

bytes

u8

按照高位在前存储的long值

 

CONSTANT_Double_info

tag

u1

值为6

bytes

u8

按照高位在前存储的double值

 

CONSTANT_Class_info

tag

u1

值为7

index

u2

指向全限定名常量项的索引

 

CONSTANT_String_info

tag

u1

值为8

index

u2

指向字符串字面量的索引

 

CONSTANT_Fieldref_info

tag

u1

值为9

index

u2

指向声明字段的类或接口描述符CONSTANT_Class_info的索引项

index

u2

指向字段名称及类型描述符CONSTANT_NameAndType_info的索引项

 

CONSTANT_Methodref_info

tag

u1

值为10

index

u2

指向声明方法的类描述符CONSTANT_Class_info的索引项

index

u2

指向方法名称及类型描述符CONSTANT_NameAndType_info的索引项

 

CONSTANT_InrerfaceMethodref_info

tag

u1

值为11

index

u2

指向声明方法的接口描述符CONSTANT_Class_info的索引项

index

u2

指向方法名称及类型描述符CONSTANT_NameAndType_info的索引项

 

CONSTANT_NameAndType_info

tag

u1

值为12

index

u2

指向字段或方法名称常量项目的索引

index

u2

指向该字段或方法描述符常量项的索引

阅读(2120) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~