Issue:
When you compile your java class, you may got following error.
The code of method is exceeding the 65535 bytes limit
Reason:
According Java specification, one Java method size must be less than 65535 Bytes (64k). In most cases you encounter this error is because you want to init a big data or your java class is generated by some toolkit.
Solution:
One workaround is divide your big size method into some pieces of small size methods.
For example,
public static Float[][] getSMatrix()
{
initSMatrixPart1() ;
initSMatrixPart2() ;
initSMatrixPart3() ;
initSMatrixPart4() ;
initSMatrixPart5() ;
return sMatrix;
}
本文介绍了当Java方法大小超过65535字节限制时的常见错误及原因,并提供了一种通过将大型方法拆分为多个小型方法的解决策略。
9757

被折叠的 条评论
为什么被折叠?



