【发布时间】:2012-08-28 18:05:38
【问题描述】:
我有以下代码:
public static void main(String[] args) {
try {
String[] studentnames = {
/* this is an array of 9000 strings... */
};
}
}
尝试编译时出现以下错误:
The code of method main(String[]) is exceeding the 65535 bytes limit
【问题讨论】:
-
The amount of code per non-native, non-abstract method is limited to 65536 bytes by the sizes of the indices in the exception_table of the Code attribute (§4.7.3), in the LineNumberTable attribute (§4.7.8), and in the LocalVariableTable attribute (§4.7.9).根据java文档docs.oracle.com/javase/specs/#88659 -
是 9000 还是 90,000 ?
标签: java compiler-errors