最大大小的java类/异常表 [英] maximum size of java class / exception table
问题描述
我想知道一个java类的最大大小是多少。如此处所示 http:// docs。 oracle.com/javase/specs/jvms/se5.0/html/ClassFile.doc.html#1546 在代码属性结构中,代码长度指定为4字节,因此它是一个大数字。我不明白的是,异常表的pc属性是2字节。
I was wondering what is the maximum size of a java class. As shown here http://docs.oracle.com/javase/specs/jvms/se5.0/html/ClassFile.doc.html#1546 in the Code attribute structure, code length is specified as 4-bytes, so it is a big number. What I did not understand is that the pc attributes of exception table are 2 bytes. How can it work if code length is more than 2-bytes but exception tables can only address the 2-bytes ?
推荐答案
code_length
项目的值必须
The value of the
code_length
item must be less than65536
.
因此,尽管它是一个4字节的值,它不能超过64k。
So although it is a 4 byte value, it must not exceed 64k.
这篇关于最大大小的java类/异常表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!