자바 코딩 65kb 오버플로우 해결법 질문합니다

조회수 1008회

자바 코딩을 많이 해서 오버 플로우가 났습니다

The code of method main(String[]) is exceeding the 65535 bytes limit

계속 코딩을 이어 나가고 싶은데 어떻게 하면 될까요?

이클립스 옥시젠 사용중입니다

  • (•́ ✖ •̀)
    알 수 없는 사용자
  • 저 오류는 한 메서드 안에서 코딩 데이터가 오버 플로우 난 것 같은데 가장 기본적인 해결은 코딩 분할, 즉 여러 메서드로 쪼개서 구현하는 방법일 듯 한데....다른 방식이 있다면 저도 궁금하네요....반복적인 내용이나 계산식 등을 한 메서드로 정의해서 따로 구현하는 것이 어떨런지.... 알 수 없는 사용자 2019.9.17 10:25
  • Java든 어떤 언어든 메소드 하나가 65kb 이상의 분량을 갖고 있다면 그건 그 코드의 문제입니다. 분할해서 작성하세요. 엽토군 2019.9.17 17:24

1 답변

  • 스펙입니다. 훗날 변경되면 모를까 스펙이니 지킬 수 밖에 없습니다.

    The fact that end_pc is exclusive is a historical mistake in the design of the Java Virtual Machine: if the Java Virtual Machine code for a method is exactly 65535 bytes long and ends with an instruction that is 1 byte long, then that instruction cannot be protected by an exception handler. A compiler writer can work around this bug by limiting the maximum size of the generated Java Virtual Machine code for any method, instance initialization method, or static initializer (the size of any code array) to 65534 bytes.

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)