Maximum lines of code permitted in a Java class?

后端 未结 5 1455
滥情空心
滥情空心 2020-12-05 10:46

How many lines of code can a .java file contain? Does it depend on the JVM being used?

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 11:17

    I remember actually running into this limit once in a complex JSP page in Tomcat 4 (way in the past when people were still using JSPs). The java file generated from the JSP had a method that was too big to compile, I think I had to split up the file or do some other stunt, which of course was a good idea in terms of readability anyway.

    Sun's bug tracker tells me some people still have the same problem.

提交回复
热议问题