편집 기록

편집 기록
  • 프로필 정영훈님의 편집
    날짜2018.12.13

    자바의 정석 unreachable statement


    자바의 정석에서 나온 코드 그대로 작성하여 해봤는데

    public class SampleNameFor {
        public static void main(String[] args) {
            Loop1:for (int i = 2; i <= 9; i++) {
                for (int j = 1; j <= 9; j++) {
                    if (j == 5)
                        break Loop1;
                        break; ⟵ 여기서나
                        continue Loop1; ⟵ 여기서 unreachable statement 이런 오류들이 뜨는데 해결법 좀 알려주세요..
                        continue;
                    System.out.println(i + "*" + j + "=" + i * j);
                }
                System.out.println();
            }
        }
    }
    
  • 프로필 알 수 없는 사용자님의 편집
    날짜2018.12.11

    자바의 정석 unreachable statement


    자바의 정석에서 나온 코드 그대로 작성하여 해봤는데

    public class SampleNameFor { public static void main(String[] args) { Loop1:for (int i = 2; i <= 9; i++) { for (int j = 1; j <= 9; j++) { if (j == 5) break Loop1; break; ⟵ 여기서나 continue Loop1; ⟵ 여기서 unreachable statement 이런 오류들이 뜨는데 해결법 좀 알려주세요.. continue; System.out.println(i + "*" + j + "=" + i * j); } System.out.println(); } } }