Maximum size of a method in java?

后端 未结 3 600
感动是毒
感动是毒 2020-11-27 19:30

I come to know that the maximum size of a method in java is 64k. And if it exceeds, we\'ll get a compiler warning like \"Code too large to compile\". So can we call this a

3条回答
  •  暖寄归人
    2020-11-27 19:51

    If your method is longer than 50 lines including inside comments - split it. In this case you will never reach any limitation (even if one exists).

    I personally saw 1000 lines long methods (written by criminals that call themselves programmers :) ) but did not see such kind of limitation.

提交回复
热议问题