【JVM笔记】Class类文件结构

Class类文件结构

Class文件是一组以8位字节为基础单位的二进制流,各个数据项严格按照顺序紧凑地排列在Class文件之中,中间没有添加任何分隔符。Class文件格式采用一种类似于语言结构体的伪结构来存储数据,这种伪结构中只有两种数据类型:无符号数(u)和表(_info)。

组成

类型名称说明数量
u4magic魔数1
u2minor_version次版本号1
u2major_version主版本号1
u2constant_pool_count常量池容量计数器1
cp_infoconstant_pool常量池constant_pool_count-1
u2access_flags访问标志1
u2this_class类索引1
u2super_class父类索引1
u2interfaces_count接口个数计数器1
u2interfaces接口集合interfaces_count
u2fields_count字段个数计数器1
field_infofields字段集合fields_count
u2methods_count方法个数计数器1
method_infomethods方法集合methods_count
u2attributes_count属性个数计数器1
attribute_infoattributes属性集合attributes_count
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值