1cfd3bbb56
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고, Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
3.7 KiB
3.7 KiB
id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
| id | title | category | status | verification_status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | created_at | updated_at | review_reason | merge_history | tags | raw_sources | applied_in | github_commit | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| java-break-continue | Java Break Continue | Programming_Language | draft | conceptual |
|
B | 0.9 | 2026-07-04 | 2026-07-04 |
|
|
Java Break Continue
🎯 한 줄 통찰 (One-line insight)
break and continue are opposite loop-control tools — break stops the loop completely, continue skips only the current iteration and keeps looping — and they compose cleanly, as shown by the negative-number-skip/zero-stop real-life example combining both in one loop. [S1]
🧠 핵심 개념 (Core concepts)
break— already seen exiting switch statements; also exits a loop entirely. [S1]continue— skips the rest of the current iteration and moves to the next one. [S1]- Mnemonic — "break = stop the loop completely. continue = skip this round, but keep looping." [S1]
- Works in for and while loops — both statements apply to any loop type. [S1]
- Combinable — a single loop can use both break and continue for different conditions. [S1]
📖 세부 내용 (Details)
- Break in for:
for (int i = 0; i < 10; i++) { if (i == 4) { break; } System.out.println(i); }. [S1] - Continue in for:
for (int i = 0; i < 10; i++) { if (i == 4) { continue; } System.out.println(i); }. [S1] - Combined:
for (int i = 0; i < 6; i++) { if (i == 2) { continue; } if (i == 4) { break; } System.out.println(i); }— skips 2, stops at 4. [S1] - Break in while:
int i = 0; while (i < 10) { System.out.println(i); i++; if (i == 4) { break; } }. [S1] - Continue in while:
int i = 0; while (i < 10) { if (i == 4) { i++; continue; } System.out.println(i); i++; }. [S1] - Real-life array processing:
int[] numbers = {3, -1, 7, 0, 9}; for (int n : numbers) { if (n < 0) { continue; } if (n == 0) { break; } System.out.println(n); }— skips negatives, stops at zero. [S1]
⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 음수 건너뛰고 0에서 멈추는 배열 처리 예제는 필터링+조기종료 로직의 표준 패턴이다. [S1]
💻 코드 패턴 (Code patterns)
Skip negatives, stop at zero (Java):
int[] numbers = {3, -1, 7, 0, 9};
for (int n : numbers) {
if (n < 0) {
continue; // skip negative numbers
}
if (n == 0) {
break; // stop loop when zero is found
}
System.out.println(n);
}
✅ 검증 상태 및 신뢰도
- 상태: draft
- 검증 단계: conceptual
- 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
- 신뢰 점수: 0.90
- 중복 검사 결과: 신규 생성 (New discovery)
🔗 지식 그래프 (Knowledge Graph)
- 상위/루트: Java Tutorial
- 관련 개념: Java For Loop, Java While Loop, Java Switch, Java Arrays
- 참조 맥락: 반복문 제어의 핵심 도구 — 이후 Arrays 챕터에서 배열 처리와 결합된다.
📚 출처 (Sources)
- [S1] W3Schools — Java Break and Continue — https://www.w3schools.com/java/java_break.asp
📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Break and Continue" page (Astra wiki-curation, P-Reinforce v3.1 format).