“Code too large” compilation error in Java

后端 未结 13 1198
半阙折子戏
半阙折子戏 2020-11-22 14:33

Is there any maximum size for code in Java? I wrote a function with more than 10,000 lines. Actually, each line assigns a value to an array variable.

arts_b         


        
13条回答
  •  清酒与你
    2020-11-22 15:00

    As there is a size limit for methods and you don't want to redesign your code as this moment, may be you can split the array into 4-5 parts and then put them into different methods. At the time of reading the array, call all the methods in a series. You may maintain a counter as well to know how many indexes you have parsed.

提交回复
热议问题