docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화

Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
This commit is contained in:
Antigravity Agent
2026-07-05 00:10:59 +09:00
parent a397bc4720
commit 1cfd3bbb56
1495 changed files with 68534 additions and 27 deletions
+210
View File
@@ -0,0 +1,210 @@
---
id: java-tutorial-index
title: "Java Tutorial"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["Java Tutorial", "Java MOC", "Topic_Java index", "Java 목차"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.90
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "moc", "index"]
raw_sources: ["https://www.w3schools.com/java/"]
applied_in: []
github_commit: ""
---
# [[Java Tutorial]]
## 🎯 한 줄 통찰 (One-line insight)
Map of Content (MOC) for the W3Schools Java Tutorial — the root that links every core-Java-language knowledge page in this topic folder. [S1]
## 🧠 핵심 개념 (Core concepts)
- This folder (`Topic_Java`) wikifies the core Java language tutorial, one knowledge page per document, in P-Reinforce v3.1 format — same convention as `Topic_SQL` / `Topic_Python` / `Topic_HTML` / `Topic_CSS` / `Topic_JavaScript`. [S1]
- Scope: **tutorial + "Real-Life Examples" pages only**. Explicitly **excluded**: reference dumps (`ref_keyword_*`, `ref_string_*`, `ref_math_*`, `ref_arraylist_*`, `ref_linkedlist_*`, `ref_hashmap_*`, `ref_scanner_*`, `ref_arrays_*`, and the `java_ref_*` index pages for each), How-To recipes (`java_howto_*` and `java_howtos.asp` — separate "HOW TO" category), Code Challenge companion pages (`java_challenges_*`), and meta pages (Certificate/Compiler/Exercises/Quiz/Server/Syllabus/Study Plan/Interview Q&A/Videos/Examples). [S1]
- **Progress:** **118 of 118 planned docs complete — Java category done.**
- Every page roots its Knowledge Graph back to this `[[Java Tutorial]]` node.
## 📖 세부 내용 (Details)
### Basics
- [[Java Intro]] ✅
- [[Java Syntax]] ✅
- [[Java Statements]] ✅
- [[Java Output]] ✅
- [[Java Print Numbers]] ✅
- [[Java Comments]] ✅
### Variables
- [[Java Variables]] ✅
- [[Java Print Variables]] ✅
- [[Java Multiple Variables]] ✅
- [[Java Identifiers]] ✅
- [[Java Constants Final]] ✅
- [[Java Variables Real Life]] ✅
### Data Types
- [[Java Data Types]] ✅
- [[Java Numbers]] ✅
- [[Java Booleans Type]] ✅
- [[Java Characters]] ✅
- [[Java Data Types Real Life]] ✅
- [[Java Var Keyword]] ✅
- [[Java Type Casting]] ✅
### Operators
- [[Java Operators]] ✅
- [[Java Operators Arithmetic]] ✅
- [[Java Operators Assign]] ✅
- [[Java Operators Comparison]] ✅
- [[Java Operators Logical]] ✅
- [[Java Operators Precedence]] ✅
### Strings
- [[Java Strings]] ✅
- [[Java Strings Concat]] ✅
- [[Java Strings Numbers]] ✅
- [[Java Strings Special Chars]] ✅
### Math
- [[Java Math]] ✅
### Booleans
- [[Java Booleans]] ✅
- [[Java Booleans Real Life]] ✅
### Conditions
- [[Java If Else]] ✅
- [[Java Else]] ✅
- [[Java Else If]] ✅
- [[Java If Shorthand]] ✅
- [[Java Nested If]] ✅
- [[Java Conditions Logical Operators]] ✅
- [[Java Conditions Real Life]] ✅
### Switch
- [[Java Switch]] ✅
### Loops
- [[Java While Loop]] ✅
- [[Java Do While Loop]] ✅
- [[Java While Loop Real Life]] ✅
- [[Java For Loop]] ✅
- [[Java For Loop Nested]] ✅
- [[Java For Each Loop]] ✅
- [[Java For Loop Real Life]] ✅
- [[Java Break Continue]] ✅
### Arrays
- [[Java Arrays]] ✅
- [[Java Arrays Loop]] ✅
- [[Java Arrays Real Life]] ✅
- [[Java Arrays Multi]] ✅
### Methods
- [[Java Methods]] ✅
- [[Java Methods Param]] ✅
- [[Java Methods Return]] ✅
- [[Java Methods Overloading]] ✅
### Scope & Recursion
- [[Java Scope]] ✅
- [[Java Recursion]] ✅
### OOP
- [[Java OOP]] ✅
- [[Java Classes]] ✅
- [[Java Class Attributes]] ✅
- [[Java Class Methods]] ✅
- [[Java Constructors]] ✅
- [[Java This Keyword]] ✅
- [[Java Modifiers]] ✅
- [[Java Non Access Modifiers]] ✅
- [[Java Encapsulation]] ✅
- [[Java Packages]] ✅
- [[Java Inheritance]] ✅
- [[Java Polymorphism]] ✅
- [[Java Super Keyword]] ✅
- [[Java Inner Classes]] ✅
- [[Java Abstraction]] ✅
- [[Java Interface]] ✅
- [[Java Anonymous]] ✅
- [[Java Enums]] ✅
- [[Java Enum Constructor]] ✅
### User Input & Date
- [[Java User Input]] ✅
- [[Java Date]] ✅
### Errors & Exceptions
- [[Java Errors]] ✅
- [[Java Debugging]] ✅
- [[Java Try Catch]] ✅
- [[Java Exceptions Multiple]] ✅
- [[Java Try Catch Resources]] ✅
### Files & I/O
- [[Java Files]] ✅
- [[Java Files Create]] ✅
- [[Java Files Write]] ✅
- [[Java Files Read]] ✅
- [[Java Files Delete]] ✅
- [[Java IO Streams]] ✅
- [[Java FileInputStream]] ✅
- [[Java FileOutputStream]] ✅
- [[Java BufferedReader]] ✅
- [[Java BufferedWriter]] ✅
### Data Structures & Collections
- [[Java Data Structures]] ✅
- [[Java Collections]] ✅
- [[Java List]] ✅
- [[Java ArrayList]] ✅
- [[Java LinkedList]] ✅
- [[Java Sort List]] ✅
- [[Java Set]] ✅
- [[Java HashSet]] ✅
- [[Java TreeSet]] ✅
- [[Java LinkedHashSet]] ✅
- [[Java Map]] ✅
- [[Java HashMap]] ✅
- [[Java TreeMap]] ✅
- [[Java LinkedHashMap]] ✅
- [[Java Iterator]] ✅
### Advanced
- [[Java Algorithms]] ✅
- [[Java Wrapper Classes]] ✅
- [[Java Generics]] ✅
- [[Java Annotations]] ✅
- [[Java RegEx]] ✅
- [[Java Threads]] ✅
- [[Java Lambda]] ✅
- [[Java Advanced Sorting]] ✅
- [[Java Projects]] ✅
## 🛠️ 적용 사례 (Applied in summary)
0 knowledge documents generated so far in this batch run.
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[10_Wiki]]
- **관련 개념:** [[Java Intro]], [[Java OOP]], [[Python Tutorial]], [[SQL Tutorial]]
- **참조 맥락:** SQL/Python에 이어 W3Schools 지식화 시리즈의 다음 카테고리.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Tutorial — https://www.w3schools.com/java/
## 📝 변경 이력 (Change history)
- 2026-07-04: Created Java Tutorial MOC with scope decisions and full planned page list (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,77 @@
---
id: java-abstraction
title: "Java Abstraction"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["abstract classes", "자바 추상화"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "abstraction", "abstract-class"]
raw_sources: ["https://www.w3schools.com/java/java_abstract.asp"]
applied_in: []
github_commit: ""
---
# [[Java Abstraction]]
## 🎯 한 줄 통찰 (One-line insight)
An abstract class can freely mix abstract methods (no body) and regular concrete methods (`sleep()` with a real implementation) in the same class — abstraction isn't all-or-nothing; a class can force subclasses to implement SOME behavior while providing shared behavior for the rest. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Abstraction** — hiding implementation details, showing only essential information to the user. [S1]
- **Two mechanisms** — abstract classes or interfaces (interfaces covered next chapter). [S1]
- **Abstract class** — cannot be instantiated directly; must be inherited to be used. [S1]
- **Abstract method** — declared in an abstract class, has no body; the subclass supplies the body. [S1]
- **Mixed abstract class** — can contain BOTH abstract methods and fully-implemented regular methods. [S1]
## 📖 세부 내용 (Details)
- Abstract class definition: `abstract class Animal { public abstract void animalSound(); public void sleep() { System.out.println("Zzz"); } }`. [S1]
- Cannot instantiate: `Animal myObj = new Animal(); // error`. [S1]
- Subclass provides the body: `class Pig extends Animal { public void animalSound() { System.out.println("The pig says: wee wee"); } } ... Pig myPig = new Pig(); myPig.animalSound(); myPig.sleep();`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 보안(중요 세부사항만 노출)을 위한 설계 원칙으로 소개된다. [S1]
## 💻 코드 패턴 (Code patterns)
Abstract class mixing abstract and regular methods (Java):
```java
abstract class Animal {
public abstract void animalSound(); // no body
public void sleep() { // regular method
System.out.println("Zzz");
}
}
class Pig extends Animal {
public void animalSound() {
System.out.println("The pig says: wee wee");
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Non Access Modifiers]], [[Java Polymorphism]], [[Java Interface]]
- **참조 맥락:** 인터페이스와 함께 추상화를 달성하는 두 방법 중 하나 — Interface 챕터로 직접 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Abstraction — https://www.w3schools.com/java/java_abstract.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Abstraction" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,76 @@
---
id: java-advanced-sorting
title: "Java Advanced Sorting"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["Comparator", "Comparable", "자바 고급 정렬"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "sorting", "comparator", "comparable"]
raw_sources: ["https://www.w3schools.com/java/java_advanced_sorting.asp"]
applied_in: []
github_commit: ""
---
# [[Java Advanced Sorting]]
## 🎯 한 줄 통찰 (One-line insight)
`a.year - b.year` is a one-line replacement for the verbose `if/else if/else` comparison ladder — and simply flipping it to `b.year - a.year` reverses the sort order, a trick that works specifically because subtraction naturally encodes negative/positive/zero the same way `compare()`/`compareTo()` are required to. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Problem**: `Collections.sort()` alone can't sort custom objects — you need a rule for what "comes first." [S1]
- **`Comparator` interface** — external comparison logic via `compare(obj1, obj2)`: negative (first goes first), positive (second goes first), zero (order doesn't matter). [S1]
- **`Comparable` interface** — the object compares ITSELF via `compareTo(obj)`, same return-value convention. [S1]
- **Native Comparable classes** — `String` and `Integer` already implement Comparable, which is why they sort without a custom comparator. [S1]
- **Lambda as comparator** — replaces a full Comparator class with an inline lambda matching `compare()`'s signature. [S1]
- **Subtraction trick** — `return a.year - b.year;` replaces the if/else ladder; `b.year - a.year` reverses it. [S1]
- **Comparator vs. Comparable** — Comparator: external, can sort any object (even ones you can't modify); Comparable: built into the object itself, simpler when you control the class. [S1]
## 📖 세부 내용 (Details)
- Comparator class: `class SortByYear implements Comparator { public int compare(Object obj1, Object obj2) { Car a = (Car) obj1; Car b = (Car) obj2; if (a.year < b.year) return -1; if (a.year > b.year) return 1; return 0; } } ... Collections.sort(myCars, new SortByYear());`. [S1]
- Lambda comparator: `Collections.sort(myCars, (obj1, obj2) -> { Car a = (Car) obj1; Car b = (Car) obj2; if (a.year < b.year) return -1; if (a.year > b.year) return 1; return 0; });`. [S1]
- Custom rule (even-first): `class SortEvenFirst implements Comparator { ... boolean aIsEven = (a % 2) == 0; ... }`. [S1]
- Comparable: `class Car implements Comparable { public int compareTo(Object obj) { Car other = (Car)obj; if(year < other.year) return -1; if(year > other.year) return 1; return 0; } } ... Collections.sort(myCars); // no comparator needed`. [S1]
- Subtraction shortcut: `return a.year - b.year;` (ascending) or `return b.year - a.year;` (descending). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 자동차 객체를 연도순으로 정렬하는 예제(Comparator/Comparable 두 방식 모두)가 커스텀 객체 정렬의 대표 사례다. [S1]
## 💻 코드 패턴 (Code patterns)
Subtraction shortcut for numeric comparison (Java):
```java
// Instead of:
// if(a.year < b.year) return -1;
// if(a.year > b.year) return 1;
// return 0;
return a.year - b.year; // ascending
return b.year - a.year; // descending
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Sort List]], [[Java Lambda]], [[Java Algorithms]], [[Java Projects]]
- **참조 맥락:** 커스텀 객체 정렬 — 람다 표현식 활용의 실전 사례. Projects 챕터로 이어짐(Java 튜토리얼 최종).
## 📚 출처 (Sources)
- [S1] W3Schools — Java Advanced Sorting (Comparator and Comparable) — https://www.w3schools.com/java/java_advanced_sorting.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Advanced Sorting" page (Astra wiki-curation, P-Reinforce v3.1 format).
+75
View File
@@ -0,0 +1,75 @@
---
id: java-algorithms
title: "Java Algorithms"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["Collections class algorithms", "자바 알고리즘"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "algorithms", "collections"]
raw_sources: ["https://www.w3schools.com/java/java_algorithms.asp"]
applied_in: []
github_commit: ""
---
# [[Java Algorithms]]
## 🎯 한 줄 통찰 (One-line insight)
`Collections.binarySearch()` REQUIRES the list to already be sorted — the example explicitly calls `Collections.sort(names)` immediately before `binarySearch()`, since binary search's speed advantage depends entirely on the data being in order; searching an unsorted list with it gives undefined/incorrect results. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Algorithm** — a procedure to solve a problem (search, sort, manipulate data structures). [S1]
- **`Collections` class** — provides built-in algorithms in `java.util`, avoiding the need to hand-write them. [S1]
- **`Collections.binarySearch(list, key)`** — fast search, but requires a pre-sorted list. [S1]
- **`Collections.sort(list)`** / **`sort(list, reverseOrder())`** — ascending/descending sort. [S1]
- **`Collections.max()` / `min()`** — largest/smallest element. [S1]
- **`Collections.shuffle()`** — randomly reorders elements. [S1]
- **`Collections.frequency(list, element)`** — counts occurrences of a value. [S1]
- **`Collections.swap(list, i, j)`** — swaps two elements by index. [S1]
## 📖 세부 내용 (Details)
- Binary search (must sort first): `Collections.sort(names); int index = Collections.binarySearch(names, "Angie");`. [S1]
- Max/min: `Collections.max(numbers); Collections.min(numbers);`. [S1]
- Shuffle: `Collections.shuffle(cards);`. [S1]
- Frequency: `int count = Collections.frequency(fruits, "Banana");`. [S1]
- Swap: `Collections.swap(fruits, 0, 2); // Swap first and third element`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **정렬 선행 조건**: binarySearch()는 리스트가 반드시 정렬되어 있어야 정확히 동작한다는 점이 예제에서 명시적으로 지켜짐. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 카드 셔플(Collections.shuffle)이나 과일 빈도 계산(frequency)이 실전 알고리즘 활용의 대표 사례다. [S1]
## 💻 코드 패턴 (Code patterns)
Sort-then-binarySearch pattern (Java):
```java
ArrayList<String> names = new ArrayList<>();
names.add("Liam"); names.add("Jenny"); names.add("Kasper"); names.add("Angie");
Collections.sort(names); // required before binarySearch
int index = Collections.binarySearch(names, "Angie");
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Sort List]], [[Java Iterator]], [[Java Advanced Sorting]]
- **참조 맥락:** Collections 클래스의 내장 알고리즘 — 고급 정렬(Advanced Sorting) 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Algorithms — https://www.w3schools.com/java/java_algorithms.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Algorithms" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,74 @@
---
id: java-annotations
title: "Java Annotations"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["@Override", "@Deprecated", "자바 어노테이션"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "annotations"]
raw_sources: ["https://www.w3schools.com/java/java_annotations.asp"]
applied_in: []
github_commit: ""
---
# [[Java Annotations]]
## 🎯 한 줄 통찰 (One-line insight)
`@Override` converts a silent bug into a compile error — without it, a typo like `makesound()` instead of `makeSound()` just creates an unrelated new method that never overrides anything (program still runs, just wrong), but WITH `@Override`, the same typo becomes a hard compiler error immediately, since the annotation asserts "this must match a superclass method." [S1]
## 🧠 핵심 개념 (Core concepts)
- **Annotation** — starts with `@`; gives extra information to the compiler/tools without changing runtime behavior. [S1]
- **`@Override`** — asserts a method overrides a superclass method; not required, but catches typo-based bugs at compile time. [S1]
- **`@Deprecated`** — marks a method/class as outdated; using it still works but triggers an IDE/compiler warning. [S1]
- **`@SuppressWarnings("unchecked")`** — tells the compiler to ignore a specific warning category (e.g. raw-type usage), useful for legacy code. [S1]
## 📖 세부 내용 (Details)
- @Override catching a typo: `class Dog extends Animal { @Override void makesound() { ... } } // error: method does not override or implement a method from a supertype`. [S1]
- @Deprecated: `@Deprecated static void oldMethod() { System.out.println("This method is outdated."); } // triggers deprecation warning when called`. [S1]
- @SuppressWarnings: `@SuppressWarnings("unchecked") public static void main(String[] args) { ArrayList cars = new ArrayList(); cars.add("Volvo"); }` — better fixed via `ArrayList<String> cars = new ArrayList<>();` instead of suppressing. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **@Override 생략 시 위험**: @Override를 제거해도 컴파일러가 경고하지 않으며, 프로그램이 실행은 되지만 의도한 오버라이드가 발생하지 않아 예기치 않게 동작할 수 있음이 명시됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — raw ArrayList 사용 시 발생하는 unchecked 경고를 억제하기보다 제네릭 타입을 명시해 근본적으로 고치는 방법이 권장된다. [S1]
## 💻 코드 패턴 (Code patterns)
@Override catching a method-name typo at compile time (Java):
```java
class Animal {
void makeSound() { System.out.println("Animal sound"); }
}
class Dog extends Animal {
@Override
void makesound() { // typo — triggers compile error due to @Override
System.out.println("Woof!");
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Polymorphism]], [[Java Generics]], [[Java RegEx]]
- **참조 맥락:** 컴파일러에 추가 정보를 제공하는 도구 — 정규표현식(RegEx) 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Annotations — https://www.w3schools.com/java/java_annotations.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Annotations" page (Astra wiki-curation, P-Reinforce v3.1 format).
+75
View File
@@ -0,0 +1,75 @@
---
id: java-anonymous
title: "Java Anonymous"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["anonymous class", "자바 익명 클래스"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "anonymous-class"]
raw_sources: ["https://www.w3schools.com/java/java_anonymous.asp"]
applied_in: []
github_commit: ""
---
# [[Java Anonymous]]
## 🎯 한 줄 통찰 (One-line insight)
An anonymous class body ends with a semicolon (`};`) — an easy detail to miss, since it's not closing a method or normal class, but terminating the object-creation STATEMENT `Animal myAnimal = new Animal() {...}` that happens to contain a class body inline. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Anonymous class** — a nameless class defined and instantiated in the same expression. [S1]
- **Use case** — overriding a method of an existing class/interface without writing a separate named class file. [S1]
- **Extends a class** — `new Animal() { @Override method } ;` — creates a one-off subclass instance inline. [S1]
- **Implements an interface** — the same syntax works to implement an interface on the fly. [S1]
- **Required trailing semicolon** — closes the object-creation statement, not just the class body. [S1]
## 📖 세부 내용 (Details)
- Overriding a class method anonymously: `Animal myAnimal = new Animal() { public void makeSound() { System.out.println("Woof woof"); } };`. [S1]
- Implementing an interface anonymously: `Greeting greet = new Greeting() { public void sayHello() { System.out.println("Hello, World!"); } };`. [S1]
- Use cases listed: overriding a method without a new subclass, quickly implementing an interface, passing small behaviors as objects. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 일회성 동작(override/interface 구현)을 별도 파일 없이 즉석에서 정의하는 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Anonymous class implementing an interface on the fly (Java):
```java
interface Greeting {
void sayHello();
}
Greeting greet = new Greeting() {
public void sayHello() {
System.out.println("Hello, World!");
}
};
greet.sayHello();
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Interface]], [[Java Polymorphism]], [[Java Enums]]
- **참조 맥락:** 일회성 클래스/인터페이스 구현 — Enums 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Anonymous Class — https://www.w3schools.com/java/java_anonymous.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Anonymous Class" page (Astra wiki-curation, P-Reinforce v3.1 format).
+83
View File
@@ -0,0 +1,83 @@
---
id: java-arraylist
title: "Java ArrayList"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 ArrayList"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "collections-framework", "arraylist"]
raw_sources: ["https://www.w3schools.com/java/java_arraylist.asp"]
applied_in: []
github_commit: ""
---
# [[Java ArrayList]]
## 🎯 한 줄 통찰 (One-line insight)
Storing primitives in an ArrayList requires their WRAPPER classes, not the primitives themselves — `ArrayList<Integer>` works but `ArrayList<int>` doesn't compile, because ArrayList elements are objects and Java's primitives (`int`, `boolean`, `char`, `double`) aren't objects; each has an object wrapper (`Integer`, `Boolean`, `Character`, `Double`). [S1]
## 🧠 핵심 개념 (Core concepts)
- **`ArrayList`** — a resizable array; unlike plain arrays, elements can be added/removed at any time. [S1]
- **Core methods** — `add()`, `add(index, value)` (insert at position), `get()`, `set()`, `remove()`, `clear()`, `size()`. [S1]
- **Wrapper classes required for primitives** — `Integer` for int, `Boolean` for boolean, `Character` for char, `Double` for double. [S1]
- **`Collections.sort()`** — sorts an ArrayList alphabetically (Strings) or numerically (numbers). [S1]
- **`var` keyword (Java 10+)** — infers the type, avoiding repeating `ArrayList<String>` on both sides. [S1]
- **List-typed variable holding an ArrayList** — `List<String> cars = new ArrayList<>();` — valid since ArrayList implements List; offers flexibility to swap implementations later. [S1]
## 📖 세부 내용 (Details)
- Basic creation and add: `ArrayList<String> cars = new ArrayList<String>(); cars.add("Volvo"); cars.add("BMW");`. [S1]
- Insert at index: `cars.add(0, "Mazda"); // insert at the beginning`. [S1]
- Access/modify/remove: `cars.get(0); cars.set(0, "Opel"); cars.remove(0); cars.clear(); cars.size();`. [S1]
- Loop with index or for-each: `for (int i = 0; i < cars.size(); i++) { System.out.println(cars.get(i)); }` or `for (String i : cars) { System.out.println(i); }`. [S1]
- Wrapper class for numbers: `ArrayList<Integer> myNumbers = new ArrayList<Integer>(); myNumbers.add(10);`. [S1]
- Sorting: `Collections.sort(cars); // alphabetical or numeric sort`. [S1]
- var keyword: `var cars = new ArrayList<String>();`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **원시 타입 저장 불가**: ArrayList의 요소는 객체이므로 int/boolean 등 원시 타입은 직접 저장할 수 없고 반드시 래퍼 클래스(Integer, Boolean 등)를 사용해야 함이 명시됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 문자열/숫자 리스트를 Collections.sort()로 정렬하는 것이 실전에서 자주 쓰이는 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Sorting an ArrayList with Collections.sort() (Java):
```java
import java.util.ArrayList;
import java.util.Collections;
ArrayList<String> cars = new ArrayList<String>();
cars.add("Volvo");
cars.add("BMW");
cars.add("Ford");
cars.add("Mazda");
Collections.sort(cars);
for (String i : cars) {
System.out.println(i);
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java List]], [[Java LinkedList]], [[Java Sort List]], [[Java Var Keyword]]
- **참조 맥락:** List 인터페이스의 대표 구현체 — LinkedList와의 비교 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java ArrayList — https://www.w3schools.com/java/java_arraylist.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java ArrayList" page (Astra wiki-curation, P-Reinforce v3.1 format).
+75
View File
@@ -0,0 +1,75 @@
---
id: java-arrays
title: "Java Arrays"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 배열"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "arrays"]
raw_sources: ["https://www.w3schools.com/java/java_arrays.asp"]
applied_in: []
github_commit: ""
---
# [[Java Arrays]]
## 🎯 한 줄 통찰 (One-line insight)
`new TYPE[size]` and the `{...}` literal shortcut cannot be combined (`new String[4] {"Volvo",...}` is illegal) — you must choose one of two modes: reserve empty slots to fill later, OR declare-and-populate at once, never both. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Declaration** — `String[] cars;` declares an array variable of a type with `[]`. [S1]
- **Literal initialization** — `String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};`. [S1]
- **Zero-based indexing** — `cars[0]` is the first element. [S1]
- **Element mutation** — `cars[0] = "Opel";` overwrites by index. [S1]
- **`.length`** — property (not a method call) returning element count. [S1]
- **`new` keyword** — `new String[4]` creates an empty fixed-size array to fill later; mutually exclusive with the literal shortcut in the same declaration. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **new + literal is illegal together** — `new String[4] {"Volvo", "BMW", "Ford", "Mazda"}` doesn't compile; you either specify a size (`new String[4]`) OR values (`new String[] {...}` / the bare `{...}` shortcut), never both in one `new` expression. [S1]
## 📖 세부 내용 (Details)
- Access: `String[] cars = {"Volvo", "BMW", "Ford", "Mazda"}; System.out.println(cars[0]); // Volvo`. [S1]
- Mutation: `cars[0] = "Opel"; // Now outputs Opel instead of Volvo`. [S1]
- Length: `System.out.println(cars.length); // 4`. [S1]
- Empty-then-fill with new: `String[] cars = new String[4]; cars[0] = "Volvo"; ...`. [S1]
- Equivalent forms: `String[] cars = new String[] {"Volvo", "BMW", "Ford", "Mazda"};` vs. the shortcut `String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};` (most common). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **new와 리터럴의 배타성**: new String[4]와 리터럴 초기화를 동시에 쓸 수 없다는 점이 소스에서 명시적으로 강조됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 여러 값을 하나의 변수로 관리하는 기본 자료구조로, 이후 루프/다차원 배열의 기반이 된다. [S1]
## 💻 코드 패턴 (Code patterns)
Array declaration and index access (Java):
```java
String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
System.out.println(cars[0]); // Volvo
System.out.println(cars.length); // 4
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java For Each Loop]], [[Java Arrays Loop]], [[Java Arrays Multi]]
- **참조 맥락:** 여러 값을 하나의 변수로 관리하는 기본 자료구조 — Loop/Multi 챕터로 확장.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Arrays — https://www.w3schools.com/java/java_arrays.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Arrays" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,75 @@
---
id: java-arrays-loop
title: "Java Arrays Loop"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 배열 순회"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "arrays", "loops"]
raw_sources: ["https://www.w3schools.com/java/java_arrays_loop.asp"]
applied_in: []
github_commit: ""
---
# [[Java Arrays Loop]]
## 🎯 한 줄 통찰 (One-line insight)
The choice between a regular for loop and for-each over an array comes down to whether you need the index — for-each only gives values, so tasks needing both position and value (like labeling theater seats) require the regular indexed for loop instead. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Regular for with `.length`** — `for (int i = 0; i < cars.length; i++)` iterates by index. [S1]
- **For-each (`:` read as "in")** — `for (String car : cars)` iterates values without an index. [S1]
- **Sum accumulation** — `sum += numbers[i]` inside an indexed loop. [S1]
- **Trade-off** — for-each is simpler/more readable but gives no access to the index; use regular for when index is needed. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Index-needed rule of thumb** — the source gives a concrete deciding example: printing seat numbers requires BOTH the index (seat number) and the value (occupant name), so a regular for loop is the correct choice there, not for-each. [S1]
## 📖 세부 내용 (Details)
- Indexed print: `String[] cars = {"Volvo", "BMW", "Ford", "Mazda"}; for (int i = 0; i < cars.length; i++) { System.out.println(cars[i]); }`. [S1]
- Sum: `int[] numbers = {1, 5, 10, 25}; int sum = 0; for (int i = 0; i < numbers.length; i++) { sum += numbers[i]; } System.out.println("The sum is: " + sum);`. [S1]
- For-each: `for (String car : cars) { System.out.println(car); }`. [S1]
- Index needed (seats): `String[] seats = {"Jenny", "Liam", "Angie", "Bo"}; for (int i = 0; i < seats.length; i++) { System.out.println("Seat number " + i + " is taken by " + seats[i]); }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **for-each의 한계**: 값만 제공하고 인덱스는 제공하지 않으므로, 인덱스가 필요한 경우 일반 for 루프를 써야 한다는 점이 명시됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 좌석 번호 출력처럼 인덱스+값이 모두 필요한 경우가 일반 for 루프 선택의 기준이 된다. [S1]
## 💻 코드 패턴 (Code patterns)
Sum via indexed loop (Java):
```java
int[] numbers = {1, 5, 10, 25};
int sum = 0;
for (int i = 0; i < numbers.length; i++) {
sum += numbers[i];
}
System.out.println("The sum is: " + sum);
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Arrays]], [[Java For Each Loop]], [[Java Arrays Real Life]]
- **참조 맥락:** 배열 순회의 두 가지 방법 — 인덱스 필요 여부가 선택 기준.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Arrays Loop — https://www.w3schools.com/java/java_arrays_loop.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Arrays Loop" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,77 @@
---
id: java-arrays-multi
title: "Java Arrays Multi"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["multidimensional arrays", "자바 다차원 배열"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "arrays", "multidimensional"]
raw_sources: ["https://www.w3schools.com/java/java_arrays_multi.asp"]
applied_in: []
github_commit: ""
---
# [[Java Arrays Multi]]
## 🎯 한 줄 통찰 (One-line insight)
Java's 2D arrays are actually "arrays of arrays," not a fixed grid — each row can have a different length (a "jagged array"), which the source proves by showing `myNumbers[0].length` (3) differing from `myNumbers[1].length` (5) in the same array. [S1]
## 🧠 핵심 개념 (Core concepts)
- **2D array literal** — `int[][] myNumbers = { {1, 4, 2}, {3, 6, 8} };` — each inner `{}` is one row. [S1]
- **Two-index access** — `myNumbers[row][col]`; row index first, then column. [S1]
- **Element mutation** — `myNumbers[1][2] = 9;` overwrites via the same two-index notation. [S1]
- **`.length` for rows, `[row].length` for columns** — the outer array's length is row count; each row array has its own independent length. [S1]
- **Jagged arrays are valid** — rows may have different lengths in Java. [S1]
- **Nested loop traversal** — indexed double for-loop, or double for-each (`for (int[] row : myNumbers) { for (int num : row) {...} }`). [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Jagged array support** — unlike languages that enforce rectangular grids, Java explicitly allows rows of different lengths within the same 2D array — demonstrated with a 3-element row and a 5-element row coexisting. [S1]
## 📖 세부 내용 (Details)
- Access element: `int[][] myNumbers = { {1, 4, 2}, {3, 6, 8} }; System.out.println(myNumbers[1][2]); // 8`. [S1]
- Row/col sizes: `int[][] myNumbers = { {1, 4, 2}, {3, 6, 8, 5, 2} }; System.out.println(myNumbers.length); // 2 (rows) ... myNumbers[0].length; // 3 ... myNumbers[1].length; // 5`. [S1]
- Nested for: `for (int row = 0; row < myNumbers.length; row++) { for (int col = 0; col < myNumbers[row].length; col++) { System.out.println("myNumbers[" + row + "][" + col + "] = " + myNumbers[row][col]); } }`. [S1]
- Nested for-each: `for (int[] row : myNumbers) { for (int num : row) { System.out.println(num); } }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **불규칙 배열(jagged array) 허용**: 행마다 길이가 달라도 유효하다는 점이 예제로 명확히 검증됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 표/행렬 형태 데이터 저장 및 순회의 표준 구조다. [S1]
## 💻 코드 패턴 (Code patterns)
Nested for-each over a jagged 2D array (Java):
```java
int[][] myNumbers = { {1, 4, 2}, {3, 6, 8, 5, 2} };
for (int[] row : myNumbers) {
for (int num : row) {
System.out.println(num);
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Arrays]], [[Java For Loop Nested]], [[Java Methods]]
- **참조 맥락:** 표/행렬 데이터 구조 — Methods 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Multi-Dimensional Arrays — https://www.w3schools.com/java/java_arrays_multi.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Multi-Dimensional Arrays" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,76 @@
---
id: java-arrays-real-life
title: "Java Arrays Real Life"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 배열 실전 예제"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "arrays", "examples"]
raw_sources: ["https://www.w3schools.com/java/java_arrays_reallife.asp"]
applied_in: []
github_commit: ""
---
# [[Java Arrays Real Life]]
## 🎯 한 줄 통찰 (One-line insight)
The min/max-tracking pattern initializes BOTH tracker variables to `numbers[0]` (not 0 or some sentinel), which is the safe idiom for arrays containing negative numbers — seeding with 0 would silently break the min-tracking logic if all elements were negative. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Average calculation** — sum via for-each, then divide by `.length`. [S1]
- **Lowest-value tracker** — initialize a tracker to the first element, then compare/update while iterating. [S1]
- **Break/continue array filtering** — skip negatives, stop at zero (reusing the break/continue chapter's pattern). [S1]
- **Max+min simultaneous tracking** — two trackers both initialized to `numbers[0]`, updated independently in one loop pass. [S1]
- **Indexed labeling** — seat number + occupant, requiring the regular for loop. [S1]
## 📖 세부 내용 (Details)
- Average: `int ages[] = {20, 22, 18, 35, 48, 26, 87, 70}; float avg, sum = 0; int length = ages.length; for (int age : ages) { sum += age; } avg = sum / length;`. [S1]
- Lowest value: `int lowestAge = ages[0]; for (int age : ages) { if (lowestAge > age) { lowestAge = age; } }`. [S1]
- Skip negative/stop at zero: `int[] numbers = {3, -1, 7, 0, 9}; for (int n : numbers) { if (n < 0) { continue; } if (n == 0) { break; } System.out.println(n); }`. [S1]
- Max and min together: `int[] numbers = {45, 12, 98, 33, 27}; int max = numbers[0]; int min = numbers[0]; for (int n : numbers) { if (n > max) { max = n; } if (n < min) { min = n; } }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 평균/최댓값/최솟값 계산은 배열 처리의 가장 흔한 실전 응용이다. [S1]
## 💻 코드 패턴 (Code patterns)
Simultaneous max/min tracking seeded from first element (Java):
```java
int[] numbers = {45, 12, 98, 33, 27};
int max = numbers[0];
int min = numbers[0];
for (int n : numbers) {
if (n > max) { max = n; }
if (n < min) { min = n; }
}
System.out.println("Max: " + max);
System.out.println("Min: " + min);
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Arrays Loop]], [[Java Break Continue]], [[Java Arrays Multi]]
- **참조 맥락:** 배열 순회의 실전 응용(평균/최대/최소) — 다차원 배열로 확장.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Arrays - Real-Life Examples — https://www.w3schools.com/java/java_arrays_reallife.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Arrays - Real-Life Examples" page (Astra wiki-curation, P-Reinforce v3.1 format).
+70
View File
@@ -0,0 +1,70 @@
---
id: java-booleans
title: "Java Booleans"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["boolean expressions", "자바 불리언"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "boolean", "expressions"]
raw_sources: ["https://www.w3schools.com/java/java_booleans.asp"]
applied_in: []
github_commit: ""
---
# [[Java Booleans]]
## 🎯 한 줄 통찰 (One-line insight)
A boolean expression's result can be stored in a boolean variable instead of used inline — `boolean isGreater = x > y;` — trading a bit of verbosity for readability and reusability, an optional but common practice. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`boolean`** — named after George Boole; stores true/false. [S1]
- **Boolean expression** — a comparison that evaluates to true or false, used to build program logic. [S1]
- **Storing the result** — `boolean isGreater = x > y;` captures a comparison's outcome in a named variable. [S1]
- **Trade-off** — storing vs. inline comparison is a readability/reuse choice, not a technical requirement. [S1]
## 📖 세부 내용 (Details)
- Direct comparison: `int x = 10; int y = 9; System.out.println(x > y); // true`. [S1]
- Literal comparison: `System.out.println(10 > 9); // true`. [S1]
- Equality check: `int x = 10; System.out.println(x == 10); // true`. [S1]
- Stored result: `boolean isGreater = x > y; System.out.println(isGreater);`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 이후 If...Else 챕터에서 이 boolean 표현식이 조건 분기의 기반이 된다. [S1]
## 💻 코드 패턴 (Code patterns)
Storing a comparison result (Java):
```java
int x = 10;
int y = 9;
boolean isGreater = x > y;
System.out.println(isGreater); // true
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Booleans Type]], [[Java Operators Comparison]], [[Java If Else]]
- **참조 맥락:** 모든 조건문/비교 연산의 기초 — If...Else 챕터로 직접 이어진다.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Booleans — https://www.w3schools.com/java/java_booleans.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Booleans" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,77 @@
---
id: java-booleans-real-life
title: "Java Booleans Real Life"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 불리언 실전 예제"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "boolean", "if-else"]
raw_sources: ["https://www.w3schools.com/java/java_booleans_reallife.asp"]
applied_in: []
github_commit: ""
---
# [[Java Booleans Real Life]]
## 🎯 한 줄 통찰 (One-line insight)
A raw boolean check (`myAge >= votingAge`) becomes actionable once wrapped in an if/else — this chapter's whole point is showing that booleans are the RAW MATERIAL, and if/else is what turns them into branching program behavior. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Voting-age check** — `int myAge = 25; int votingAge = 18; System.out.println(myAge >= votingAge);` prints just `true`/`false`. [S1]
- **Wrapped in if/else** — produces an actual human-readable message depending on the result. [S1]
- **Booleans as the foundation** — the source explicitly states booleans underlie all Java comparisons and conditions. [S1]
## 📖 세부 내용 (Details)
- Raw boolean output: `System.out.println(myAge >= votingAge); // true`. [S1]
- Actionable via if/else: [S1]
```java
if (myAge >= votingAge) {
System.out.println("Old enough to vote!");
} else {
System.out.println("Not old enough to vote.");
}
```
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 다음 챕터(If...Else)로 넘어가기 전, boolean이 조건문의 기반이라는 점을 명시적으로 예고한다. [S1]
## 💻 코드 패턴 (Code patterns)
Boolean check turned actionable via if/else (Java):
```java
int myAge = 25;
int votingAge = 18;
if (myAge >= votingAge) {
System.out.println("Old enough to vote!");
} else {
System.out.println("Not old enough to vote.");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Booleans]], [[Java If Else]]
- **참조 맥락:** boolean이 모든 조건문의 기반이라는 점을 예고 — 다음 챕터 If...Else로 직접 연결.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Boolean Examples — https://www.w3schools.com/java/java_booleans_reallife.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Boolean Examples" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,63 @@
---
id: java-booleans-type
title: "Java Booleans Type"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["boolean data type", "자바 불리언 타입"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "boolean"]
raw_sources: ["https://www.w3schools.com/java/java_data_types_boolean.asp"]
applied_in: []
github_commit: ""
---
# [[Java Booleans Type]]
## 🎯 한 줄 통찰 (One-line insight)
Java's boolean literals are exactly `true`/`false` (lowercase, unquoted keywords) — the primitive type built for any two-state distinction (YES/NO, ON/OFF), primarily used in conditional testing. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`boolean`** — a primitive type holding only `true` or `false`. [S1]
- **Use case** — mostly used for conditional testing. [S1]
## 📖 세부 내용 (Details)
- Basic declaration: `boolean isJavaFun = true; boolean isFishTasty = false;`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 이후 Conditions(If...Else) 챕터에서 조건 평가의 기초로 재사용된다. [S1]
## 💻 코드 패턴 (Code patterns)
Boolean declaration (Java):
```java
boolean isJavaFun = true;
boolean isFishTasty = false;
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Data Types]], [[Java If Else]], [[Java Booleans]]
- **참조 맥락:** 조건 평가의 기초 타입 — If...Else 챕터로 이어진다.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Boolean Data Types — https://www.w3schools.com/java/java_data_types_boolean.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Boolean Data Types" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,79 @@
---
id: java-break-continue
title: "Java Break Continue"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["break statement", "continue statement", "자바 break continue"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "loops", "break", "continue"]
raw_sources: ["https://www.w3schools.com/java/java_break.asp"]
applied_in: []
github_commit: ""
---
# [[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):
```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).
@@ -0,0 +1,72 @@
---
id: java-bufferedreader
title: "Java BufferedReader"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 BufferedReader"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "io", "bufferedreader", "character-stream"]
raw_sources: ["https://www.w3schools.com/java/java_bufferedreader.asp"]
applied_in: []
github_commit: ""
---
# [[Java BufferedReader]]
## 🎯 한 줄 통찰 (One-line insight)
`BufferedReader` never opens files directly — it always wraps a `FileReader`, which handles the actual file-opening while BufferedReader adds a memory buffer on top to make line-by-line reading (`readLine()`) fast for large files, a decorator-pattern relationship rather than a standalone class. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`BufferedReader`** — reads text line-by-line via `readLine()`; must be paired with `FileReader` (which opens the file). [S1]
- **`readLine()`** — returns `null` at end-of-file, used as the loop termination condition. [S1]
- **Buffer for speed** — the class uses an internal memory buffer to make reading faster than unbuffered access. [S1]
- **Best use case** — large text files, since it's faster and uses less memory than Scanner. [S1]
## 📖 세부 내용 (Details)
- Line-by-line read: `try (BufferedReader br = new BufferedReader(new FileReader("filename.txt"))) { String line; while ((line = br.readLine()) != null) { System.out.println(line); } } catch (IOException e) {...}`. [S1]
- Class comparison: Scanner (simple text, split into lines/words/numbers), BufferedReader (large text files, faster, less memory, readLine()), FileInputStream (binary files). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 대용량 텍스트 파일을 빠르게 한 줄씩 읽는 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Reading a file line by line with BufferedReader (Java):
```java
try (BufferedReader br = new BufferedReader(new FileReader("filename.txt"))) {
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
} catch (IOException e) {
System.out.println("Error reading file.");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java FileInputStream]], [[Java BufferedWriter]], [[Java Files Read]]
- **참조 맥락:** 버퍼링을 통한 빠른 텍스트 읽기 — BufferedWriter와 대칭되는 쓰기 클래스.
## 📚 출처 (Sources)
- [S1] W3Schools — Java BufferedReader — https://www.w3schools.com/java/java_bufferedreader.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java BufferedReader and BufferedWriter" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,73 @@
---
id: java-bufferedwriter
title: "Java BufferedWriter"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 BufferedWriter"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "io", "bufferedwriter", "character-stream"]
raw_sources: ["https://www.w3schools.com/java/java_bufferedwriter.asp"]
applied_in: []
github_commit: ""
---
# [[Java BufferedWriter]]
## 🎯 한 줄 통찰 (One-line insight)
`BufferedWriter`'s `newLine()` is the platform-independent way to insert line breaks — unlike hardcoding `"\n"` in a string, `newLine()` uses the correct line separator for whatever OS the program runs on, though the source primarily frames it as a convenience method rather than a portability guarantee. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`BufferedWriter`** — writes text line/string at a time; must be paired with `FileWriter` (which opens/creates the file). [S1]
- **`.newLine()`** — inserts a line break, an alternative to embedding `\n` manually. [S1]
- **Default overwrite** — like FileWriter, replaces existing file content unless append mode is used. [S1]
- **Append mode** — pass `true` to the underlying `FileWriter` constructor: `new FileWriter("filename.txt", true)`. [S1]
## 📖 세부 내용 (Details)
- Basic write with newLine(): `try (BufferedWriter bw = new BufferedWriter(new FileWriter("filename.txt"))) { bw.write("First line"); bw.newLine(); bw.write("Second line"); } catch (IOException e) {...}`. [S1]
- Append mode: `try (BufferedWriter bw = new BufferedWriter(new FileWriter("filename.txt", true))) { bw.newLine(); bw.write("Appended line"); }`. [S1]
- Class comparison: FileWriter (simple/quick), BufferedWriter (faster for large files, easy newLine()), FileOutputStream (binary files). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 여러 줄의 텍스트를 newLine()으로 구분하며 파일에 쓰는 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Writing multiple lines with newLine() (Java):
```java
try (BufferedWriter bw = new BufferedWriter(new FileWriter("filename.txt"))) {
bw.write("First line");
bw.newLine(); // add line break
bw.write("Second line");
System.out.println("Successfully wrote to the file.");
} catch (IOException e) {
System.out.println("Error writing file.");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java BufferedReader]], [[Java FileOutputStream]], [[Java Files Write]]
- **참조 맥락:** 버퍼링을 통한 빠른 텍스트 쓰기 — Data Structures & Collections 섹션으로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java BufferedWriter — https://www.w3schools.com/java/java_bufferedwriter.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java BufferedWriter" page (Astra wiki-curation, P-Reinforce v3.1 format).
+71
View File
@@ -0,0 +1,71 @@
---
id: java-characters
title: "Java Characters"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["char type", "ASCII values", "자바 문자 타입"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "char", "string", "ascii"]
raw_sources: ["https://www.w3schools.com/java/java_data_types_characters.asp"]
applied_in: []
github_commit: ""
---
# [[Java Characters]]
## 🎯 한 줄 통찰 (One-line insight)
A `char` can be assigned either a single-quoted character literal OR its raw ASCII integer value — `char myVar1 = 65;` prints "A" just as reliably as `char myVar1 = 'A';`, since char IS a numeric type under the hood. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`char`** — stores a single character, in single quotes (`'A'`). [S1]
- **ASCII assignment** — a char can also be assigned its numeric ASCII value directly (e.g. `65` displays as `A`). [S1]
- **`String`** — a sequence of characters (text), double-quoted; technically a NON-primitive type, since it refers to an object with methods. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **char is secretly numeric** — being able to assign `char myVar1 = 65;` and have it print `A` reveals that `char` is really a 16-bit numeric type interpreted as a character, not a distinct "letter" type. [S1]
## 📖 세부 내용 (Details)
- Basic char: `char myGrade = 'B';`. [S1]
- ASCII-based assignment: `char myVar1 = 65, myVar2 = 66, myVar3 = 67;` prints A, B, C. [S1]
- String (non-primitive): `String greeting = "Hello World";`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **String은 원시 타입이 아님**: 소스에서 String을 "특별한 아홉 번째 타입"이라 부르면서도, 실제로는 객체를 참조하는 비원시 타입이라고 명시함 — 이는 8개 원시 타입 목록과 별개로 이해해야 한다. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — String의 "객체"라는 개념은 이후 OOP/Classes 챕터에서 본격적으로 다뤄진다. [S1]
## 💻 코드 패턴 (Code patterns)
char via ASCII value (Java):
```java
char myVar1 = 65, myVar2 = 66, myVar3 = 67;
System.out.println(myVar1); // A
System.out.println(myVar2); // B
System.out.println(myVar3); // C
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Data Types]], [[Java Strings]], [[Java Classes]]
- **참조 맥락:** char가 숫자 타입의 일종이라는 점, String이 비원시(객체) 타입이라는 점의 첫 소개.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Characters — https://www.w3schools.com/java/java_data_types_characters.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Characters" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,73 @@
---
id: java-class-attributes
title: "Java Class Attributes"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["fields", "자바 클래스 속성"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "attributes"]
raw_sources: ["https://www.w3schools.com/java/java_class_attributes.asp"]
applied_in: []
github_commit: ""
---
# [[Java Class Attributes]]
## 🎯 한 줄 통찰 (One-line insight)
Attributes on separate object instances are fully independent — changing `myObj2.x` to 25 leaves `myObj1.x` at its original 5, demonstrating that each object carries its own copy of non-static attribute state rather than sharing it. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Attribute** — a variable declared inside a class; also called a "field". [S1]
- **Dot syntax access** — `myObj.x` reads or writes an attribute via an object reference. [S1]
- **Mutation vs. override** — assigning a new value to an uninitialized field vs. changing an already-initialized field, functionally the same mechanism. [S1]
- **`final`** — prevents overriding an attribute's value after initialization; introduced here as a preview of the Modifiers chapter. [S1]
- **Per-object independence** — each object's attributes are separate; modifying one instance doesn't affect another. [S1]
## 📖 세부 내용 (Details)
- Access: `Main myObj = new Main(); System.out.println(myObj.x);`. [S1]
- Modify: `myObj.x = 40;`. [S1]
- Final (immutable) attribute: `final int x = 10; ... myObj.x = 25; // Error: cannot assign a value to a final variable`. [S1]
- Independent instances: `myObj2.x = 25; System.out.println(myObj1.x); // 5 (unchanged) System.out.println(myObj2.x); // 25`. [S1]
- Multiple attributes: `String fname = "John"; String lname = "Doe"; int age = 24;`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — final 키워드로 PI(3.14159...)처럼 불변 상수를 표현하는 예시가 실전 적용의 대표 사례다. [S1]
## 💻 코드 패턴 (Code patterns)
Independent attribute state across objects (Java):
```java
Main myObj1 = new Main(); // Object 1
Main myObj2 = new Main(); // Object 2
myObj2.x = 25;
System.out.println(myObj1.x); // Outputs 5
System.out.println(myObj2.x); // Outputs 25
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Classes]], [[Java Class Methods]], [[Java Modifiers]], [[Java Constants Final]]
- **참조 맥락:** 클래스 변수(필드)의 접근/수정 — final 키워드는 Modifiers 챕터에서 심화.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Class Attributes — https://www.w3schools.com/java/java_class_attributes.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Class Attributes" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,77 @@
---
id: java-class-methods
title: "Java Class Methods"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 클래스 메서드"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "methods"]
raw_sources: ["https://www.w3schools.com/java/java_class_methods.asp"]
applied_in: []
github_commit: ""
---
# [[Java Class Methods]]
## 🎯 한 줄 통찰 (One-line insight)
Non-static instance methods (`fullThrottle()`, `speed()` without `static`) MUST be called through an object reference (`myCar.fullThrottle()`), unlike the earlier `static void myMethod()` examples which could be called bare — the presence/absence of `static` determines whether an object is required to invoke a method. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Instance method** — declared without `static`; must be called via an object (`objectName.methodName()`). [S1]
- **Dot syntax for methods** — same `.` operator used for attributes now invokes methods on an object. [S1]
- **Method with parameter on an object** — `myCar.speed(200);` passes an argument through the object reference. [S1]
- **Multi-class organization** — Main.java holds the class+methods, Second.java holds `main()` that instantiates and calls them (same pattern as Classes chapter). [S1]
## 📖 세부 내용 (Details)
- Instance methods defined and called: `public void fullThrottle() { System.out.println("The car is going as fast as it can!"); } public void speed(int maxSpeed) { System.out.println("Max speed is: " + maxSpeed); } ... Main myCar = new Main(); myCar.fullThrottle(); myCar.speed(200);`. [S1]
- Explained: object creation is required before methods can be called via dot syntax, contrasted with earlier static-method examples. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 자동차(Car) 객체의 fullThrottle/speed 메서드 호출이 인스턴스 메서드 활용의 대표 예시다. [S1]
## 💻 코드 패턴 (Code patterns)
Calling instance methods via an object reference (Java):
```java
public class Main {
public void fullThrottle() {
System.out.println("The car is going as fast as it can!");
}
public void speed(int maxSpeed) {
System.out.println("Max speed is: " + maxSpeed);
}
public static void main(String[] args) {
Main myCar = new Main();
myCar.fullThrottle();
myCar.speed(200);
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Class Attributes]], [[Java Constructors]], [[Java Methods]]
- **참조 맥락:** 인스턴스 메서드는 객체를 통해서만 호출 가능 — 생성자 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Class Methods — https://www.w3schools.com/java/java_class_methods.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Class Methods" page (Astra wiki-curation, P-Reinforce v3.1 format).
+76
View File
@@ -0,0 +1,76 @@
---
id: java-classes
title: "Java Classes"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["classes and objects", "자바 클래스"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "classes"]
raw_sources: ["https://www.w3schools.com/java/java_classes.asp"]
applied_in: []
github_commit: ""
---
# [[Java Classes]]
## 🎯 한 줄 통찰 (One-line insight)
Java enforces a strict class-filename match (`Main` must live in `Main.java`), which becomes essential once splitting code across multiple classes/files — the multi-class example explicitly shows `Main.java` holding the data class while `Second.java` holds the class with `main()`. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Class** — an object constructor/"blueprint" for creating objects. [S1]
- **`class` keyword** — declares a class; name should start uppercase and match the filename. [S1]
- **`new` keyword** — creates an object instance from a class: `Main myObj = new Main();`. [S1]
- **Multiple objects** — each independent instance of the same class. [S1]
- **Multiple classes/files** — one class can hold attributes/methods, another can hold `main()` — common organizational pattern. [S1]
## 📖 세부 내용 (Details)
- Class definition: `public class Main { int x = 5; }`. [S1]
- Object creation and access: `Main myObj = new Main(); System.out.println(myObj.x); // 5`. [S1]
- Multiple objects: `Main myObj1 = new Main(); Main myObj2 = new Main();` — each independently prints `x = 5`. [S1]
- Multi-file pattern: `Main.java` defines `class Main { int x = 5; }`; `Second.java` defines `class Second { public static void main(...) { Main myObj = new Main(); System.out.println(myObj.x); } }`; compiled/run via `javac Main.java`, `javac Second.java`, `java Second`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 클래스와 main() 실행 로직을 별도 파일로 분리하는 구조가 이후 OOP 전반의 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Multiple independent objects (Java):
```java
public class Main {
int x = 5;
public static void main(String[] args) {
Main myObj1 = new Main(); // Object 1
Main myObj2 = new Main(); // Object 2
System.out.println(myObj1.x);
System.out.println(myObj2.x);
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java OOP]], [[Java Class Attributes]], [[Java Class Methods]], [[Java Constructors]]
- **참조 맥락:** 클래스 선언/객체 생성의 기초 문법 — 속성/메서드 챕터로 확장.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Classes and Objects — https://www.w3schools.com/java/java_classes.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Classes/Objects" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,62 @@
---
id: java-collections
title: "Java Collections"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["Collections Framework", "자바 컬렉션 프레임워크"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "collections-framework"]
raw_sources: ["https://www.w3schools.com/java/java_collections.asp"]
applied_in: []
github_commit: ""
---
# [[Java Collections]]
## 🎯 한 줄 통찰 (One-line insight)
The Collections Framework separates WHAT a structure can do (interfaces like List/Set/Map) from HOW it does it (classes like ArrayList/HashSet/HashMap) — the toolbox analogy makes explicit that List defines a contract while ArrayList and LinkedList are two different tools fulfilling that same contract differently. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Java Collections Framework** — a set of interfaces (`List`, `Set`, `Map`) plus implementing classes, all in `java.util`. [S1]
- **`List` interface** — ordered, allows duplicates; implemented by `ArrayList`, `LinkedList`. [S1]
- **`Set` interface** — unique elements only; implemented by `HashSet`, `TreeSet`, `LinkedHashSet`. [S1]
- **`Map` interface** — key-value pairs with unique keys; implemented by `HashMap`, `TreeMap`, `LinkedHashMap`. [S1]
- **Selection heuristic** — List for order+duplicates+index access; Set for uniqueness; Map for key-based pairs. [S1]
## 📖 세부 내용 (Details)
- Class overview table: ArrayList (resizable, ordered, duplicates), LinkedList (fast insert/remove), HashSet (unordered unique), TreeSet (sorted unique, natural order), LinkedHashSet (insertion-order unique), HashMap (unordered key-value), TreeMap (sorted key-value by key), LinkedHashMap (insertion-order key-value). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 인터페이스와 구현 클래스의 분리 구조가 List/Set/Map 각 챕터의 이론적 틀을 제공한다. [S1]
## 💻 코드 패턴 (Code patterns)
해당 챕터는 개념/분류표 중심으로 별도 실행 코드 예제가 없음 — 다음 챕터([[Java List]])에서 List 인터페이스 실습이 시작된다.
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Data Structures]], [[Java List]], [[Java Set]], [[Java Map]]
- **참조 맥락:** 인터페이스-구현체 분리 구조 — List/Set/Map 각 챕터의 이론적 틀.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Collections Framework — https://www.w3schools.com/java/java_collections.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Collections Framework" page (Astra wiki-curation, P-Reinforce v3.1 format).
+67
View File
@@ -0,0 +1,67 @@
---
id: java-comments
title: "Java Comments"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 주석"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "comments"]
raw_sources: ["https://www.w3schools.com/java/java_comments.asp"]
applied_in: []
github_commit: ""
---
# [[Java Comments]]
## 🎯 한 줄 통찰 (One-line insight)
Unlike Python, Java has a REAL native multi-line comment syntax (`/* ... */`) — no unassigned-string workaround needed. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Single-line comment (`//`)** — everything from `//` to end of line is ignored. [S1]
- **Multi-line comment (`/* ... */`)** — everything between the markers is ignored, natively supported. [S1]
- **Style convention** — `//` for short comments, `/* */` for longer ones. [S1]
## 📖 세부 내용 (Details)
- Single-line before code: `// This is a comment` then `System.out.println("Hello World");`. [S1]
- Single-line at end of line: `System.out.println("Hello World"); // This is a comment`. [S1]
- Multi-line block: `/* The code below will print the words Hello World to the screen, and it is amazing */`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 코드 문서화 및 디버깅 시 코드 일부 비활성화에 표준적으로 쓰인다. [S1]
## 💻 코드 패턴 (Code patterns)
Native multi-line comment (Java):
```java
/* The code below will print the words Hello World
to the screen, and it is amazing */
System.out.println("Hello World");
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Syntax]], [[Python Comments]]
- **참조 맥락:** Python과 달리 진짜 멀티라인 주석 문법을 네이티브로 지원.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Comments — https://www.w3schools.com/java/java_comments.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Comments" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,75 @@
---
id: java-conditions-logical-operators
title: "Java Conditions Logical Operators"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["logical operators in conditions", "자바 조건 논리 연산자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "conditions", "logical-operators"]
raw_sources: ["https://www.w3schools.com/java/java_conditions_logical.asp"]
applied_in: []
github_commit: ""
---
# [[Java Conditions Logical Operators]]
## 🎯 한 줄 통찰 (One-line insight)
Real-world access-control logic often nests logical operators — `isLoggedIn && (isAdmin || securityLevel <= 2)` requires login as a hard gate, then OR-branches between two different ways of satisfying the second requirement, showing how && and || combine into layered authorization rules. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`&&` (AND)** — all conditions must be true. [S1]
- **`||` (OR)** — at least one condition must be true. [S1]
- **`!` (NOT)** — reverses a condition (true↔false). [S1]
- **Combines with if/else/else-if** — logical operators build more complex decision conditions. [S1]
- **Grouping with parentheses** — `(isAdmin || securityLevel <= 2)` groups an OR sub-expression before ANDing with the login gate. [S1]
## 📖 세부 내용 (Details)
- AND: `int a = 200; int b = 33; int c = 500; if (a > b && c > a) { System.out.println("Both conditions are true"); }`. [S1]
- OR: `if (a > b || a > c) { System.out.println("At least one condition is true"); }`. [S1]
- NOT: `int a = 33; int b = 200; if (!(a > b)) { System.out.println("a is NOT greater than b"); }`. [S1]
- Access-control real-life example: `boolean isLoggedIn = true; boolean isAdmin = false; int securityLevel = 3; if (isLoggedIn && (isAdmin || securityLevel <= 2)) { System.out.println("Access granted"); } else { System.out.println("Access denied"); }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 로그인 + (관리자 OR 높은 보안등급) 형태의 접근 제어 로직은 실제 인증 시스템의 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Layered access control with && and || (Java):
```java
boolean isLoggedIn = true;
boolean isAdmin = false;
int securityLevel = 3; // 1 = highest
if (isLoggedIn && (isAdmin || securityLevel <= 2)) {
System.out.println("Access granted");
} else {
System.out.println("Access denied");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Operators Logical]], [[Java Nested If]], [[Java Conditions Real Life]]
- **참조 맥락:** 논리 연산자를 조건문에 적용 — 접근 제어 등 실전 로직의 기반.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Logical Operators in Conditions — https://www.w3schools.com/java/java_conditions_logical.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Logical Operators in Conditions" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,79 @@
---
id: java-conditions-real-life
title: "Java Conditions Real Life"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 조건문 실전 예제"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "conditions", "examples"]
raw_sources: ["https://www.w3schools.com/java/java_conditions_reallife.asp"]
applied_in: []
github_commit: ""
---
# [[Java Conditions Real Life]]
## 🎯 한 줄 통찰 (One-line insight)
This chapter is a synthesis roundup — door-code checks, sign detection, voting eligibility, even/odd via modulo, temperature bands, and access control — showing that the entire if/else/else-if/nested-if/logical-operator toolkit converges on the same handful of real-world decision patterns. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Door code check** — equality comparison gating access. [S1]
- **Positive/negative/zero classification** — three-way branch via if/else-if/else. [S1]
- **Voting age check** — simple threshold comparison. [S1]
- **Nested voting + citizenship** — combining nested if with else at each level. [S1]
- **Even/odd via modulo** — `myNum % 2 == 0` as the even-test idiom. [S1]
- **Temperature banding** — three-way else-if chain by numeric range. [S1]
- **Access control** — `isLoggedIn && (isAdmin || securityLevel <= 2)`. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Modulo-based even/odd check** — `myNum % 2 == 0` is the canonical idiom, reused across virtually every language's conditions tutorial (same pattern in Python's chapters). [S1]
## 📖 세부 내용 (Details)
- Door code: `int doorCode = 1337; if (doorCode == 1337) { System.out.println("Correct code. The door is now open."); } else { System.out.println("Wrong code. The door remains closed."); }`. [S1]
- Sign classification: `int myNum = 10; if (myNum > 0) {...} else if (myNum < 0) {...} else { System.out.println("The value is 0."); }`. [S1]
- Voting age: `int myAge = 25; int votingAge = 18; if (myAge >= votingAge) { System.out.println("Old enough to vote!"); } else {...}`. [S1]
- Even/odd: `int myNum = 5; if (myNum % 2 == 0) { System.out.println(myNum + " is even"); } else { System.out.println(myNum + " is odd"); }`. [S1]
- Temperature bands: `int temperature = 30; if (temperature < 0) {...} else if (temperature < 20) {...} else { System.out.println("It's warm."); }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 이 챕터 자체가 앞선 조건문 챕터들(If/Else/Else If/Nested If/Logical Operators)의 실전 종합 예제 모음이다. [S1]
## 💻 코드 패턴 (Code patterns)
Even/odd via modulo (Java):
```java
int myNum = 5;
if (myNum % 2 == 0) {
System.out.println(myNum + " is even");
} else {
System.out.println(myNum + " is odd");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java If Else]], [[Java Nested If]], [[Java Conditions Logical Operators]], [[Java Switch]]
- **참조 맥락:** 조건문 섹션 전체의 실전 종합 예제 — Switch 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java If ... Else Examples — https://www.w3schools.com/java/java_conditions_reallife.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java If ... Else Examples" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,66 @@
---
id: java-constants-final
title: "Java Constants Final"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["final keyword", "자바 상수"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "final", "constants"]
raw_sources: ["https://www.w3schools.com/java/java_variables_final.asp"]
applied_in: []
github_commit: ""
---
# [[Java Constants Final]]
## 🎯 한 줄 통찰 (One-line insight)
`final` variables are conventionally written in UPPER_CASE (e.g. `BIRTHYEAR`) — a style-only convention, not enforced by the compiler, but a strong readability signal that a value is a true constant. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`final` keyword** — makes a variable a constant: unchangeable and read-only. [S1]
- **Reassignment error** — attempting to change a final variable raises a compile error. [S1]
- **When to use** — for values that should never change (minutes per hour, a birth year). [S1]
- **Naming convention** — final variables are usually written in UPPER_CASE (not enforced, just convention). [S1]
## 📖 세부 내용 (Details)
- Basic final: `final int myNum = 15; myNum = 20; // Error`. [S1]
- Named constants: `final int MINUTES_PER_HOUR = 60; final int BIRTHYEAR = 1980;`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 절대 변경되지 않아야 하는 값(설정값, 물리 상수 등)에 표준적으로 쓰인다. [S1]
## 💻 코드 패턴 (Code patterns)
Named constants with final (Java):
```java
final int MINUTES_PER_HOUR = 60;
final int BIRTHYEAR = 1980;
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Variables]], [[Java Modifiers]]
- **참조 맥락:** 불변 값을 강제하는 표준 도구 — Modifiers 챕터에서 다른 접근 제어자와 함께 다뤄진다.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Constants (final) — https://www.w3schools.com/java/java_variables_final.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Constants (final)" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,78 @@
---
id: java-constructors
title: "Java Constructors"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 생성자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "constructors"]
raw_sources: ["https://www.w3schools.com/java/java_constructors.asp"]
applied_in: []
github_commit: ""
---
# [[Java Constructors]]
## 🎯 한 줄 통찰 (One-line insight)
Every class gets a constructor whether you write one or not — if you don't declare one, Java silently generates a default one, but that hidden default can't set custom initial values, which is the practical reason to write your own. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Constructor** — a special method that initializes an object; runs automatically when an object is created. [S1]
- **Naming rule** — the constructor's name must match the class name exactly. [S1]
- **No return type** — a constructor cannot declare a return type, not even `void`. [S1]
- **Implicit default constructor** — Java auto-generates one if none is written, but it can't set custom initial values. [S1]
- **Constructor parameters** — like methods, constructors can take parameters used to set initial attribute values. [S1]
## 📖 세부 내용 (Details)
- Basic constructor: `public class Main { int x; public Main() { x = 5; } public static void main(String[] args) { Main myObj = new Main(); System.out.println(myObj.x); } } // Outputs 5`. [S1]
- Constructor with one parameter: `public Main(int y) { x = y; } ... new Main(5); // x = 5`. [S1]
- Constructor with multiple parameters: `public Main(int year, String name) { modelYear = year; modelName = name; } ... new Main(1969, "Mustang"); // "1969 Mustang"`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **기본 생성자의 한계**: 명시적으로 생성자를 작성하지 않으면 Java가 자동 생성하지만, 이 경우 초기값을 커스터마이즈할 수 없다는 점이 강조됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 자동차 모델(연도+이름)처럼 여러 초기값을 한 번에 설정하는 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Constructor with multiple parameters (Java):
```java
public class Main {
int modelYear;
String modelName;
public Main(int year, String name) {
modelYear = year;
modelName = name;
}
public static void main(String[] args) {
Main myCar = new Main(1969, "Mustang");
System.out.println(myCar.modelYear + " " + myCar.modelName);
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Class Methods]], [[Java This Keyword]], [[Java Modifiers]]
- **참조 맥락:** 객체 초기화 메서드 — this 키워드 챕터로 직접 이어짐(파라미터명 충돌 해결).
## 📚 출처 (Sources)
- [S1] W3Schools — Java Constructors — https://www.w3schools.com/java/java_constructors.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Constructors" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,71 @@
---
id: java-data-structures
title: "Java Data Structures"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 자료구조 개요"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "data-structures"]
raw_sources: ["https://www.w3schools.com/java/java_data_structures.asp"]
applied_in: []
github_commit: ""
---
# [[Java Data Structures]]
## 🎯 한 줄 통찰 (One-line insight)
The choice between ArrayList/HashSet/HashMap comes down to a single 3-column decision table (order-kept? duplicates-allowed? best-for) — order+duplicates → ArrayList, uniqueness → HashSet, key-based lookup → HashMap, giving a fast heuristic before diving into each structure's details. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Data structure** — a way to store/organize data efficiently; arrays are the simplest example. [S1]
- **`ArrayList`** — resizable array; keeps insertion order; allows duplicates; access by index. [S1]
- **`HashSet`** — every element unique; adding a duplicate is silently ignored; no fixed order. [S1]
- **`HashMap`** — stores key-value pairs for fast lookup by key; keys unique, values can duplicate. [S1]
- **Iterator** — a standard way to loop through any data structure via `hasNext()`/`next()`. [S1]
## 📖 세부 내용 (Details)
- ArrayList: `ArrayList<String> cars = new ArrayList<String>(); cars.add("Volvo"); cars.add("BMW"); ...`. [S1]
- HashSet dedup: `HashSet<String> cars = new HashSet<String>(); cars.add("BMW"); cars.add("BMW"); // duplicate ignored`. [S1]
- HashMap key-value: `HashMap<String, String> capitalCities = new HashMap<String, String>(); capitalCities.put("England", "London"); ...`. [S1]
- Iterator loop: `Iterator<String> it = cars.iterator(); while(it.hasNext()) { System.out.println(it.next()); }`. [S1]
- Comparison table: ArrayList (ordered, duplicates OK, index access), HashSet (unique, no order, fast checks), HashMap (key-value, no order, fast key lookup). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 국가-수도 매핑(HashMap)이 키 기반 조회의 대표 예시다. [S1]
## 💻 코드 패턴 (Code patterns)
Quick comparison: ArrayList, HashSet, HashMap (Java):
```java
ArrayList<String> cars = new ArrayList<String>(); // ordered, duplicates OK
HashSet<String> uniqueCars = new HashSet<String>(); // unique only
HashMap<String, String> capitalCities = new HashMap<String, String>(); // key-value
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Collections]], [[Java List]], [[Java Set]], [[Java Map]], [[Java Iterator]]
- **참조 맥락:** 자료구조 전체 섹션의 개념적 도입부 — Collections Framework 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Data Structures — https://www.w3schools.com/java/java_data_structures.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Data Structures" page (Astra wiki-curation, P-Reinforce v3.1 format).
+70
View File
@@ -0,0 +1,70 @@
---
id: java-data-types
title: "Java Data Types"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["primitive types", "자바 자료형"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "datatypes", "primitive"]
raw_sources: ["https://www.w3schools.com/java/java_data_types.asp"]
applied_in: []
github_commit: ""
---
# [[Java Data Types]]
## 🎯 한 줄 통찰 (One-line insight)
Once a Java variable is declared with a type, it can NEVER change type — the compiler enforces this as a safety guarantee, and the only way to bridge types is explicit type casting. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Two groups** — primitive types (`byte`, `short`, `int`, `long`, `float`, `double`, `boolean`, `char`) and non-primitive types (`String`, arrays, classes). [S1]
- **8 primitive types** — each with a fixed value range/precision (e.g. `byte`: -128 to 127; `int`: ~±2.1 billion; `long`: ~±9.2 quintillion; `float`: 6-7 decimal digits; `double`: 15-16 decimal digits). [S1]
- **Type is permanent** — once declared, a variable's type cannot change. [S1]
- **Compiler-enforced safety** — mixing types (e.g. assigning a String to an int) is a compile error, not a runtime surprise. [S1]
- **Type casting** — the explicit mechanism to convert between types when needed. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Static typing as a safety net** — the tutorial explicitly frames the "cannot change type" rule as making Java SAFER, since the compiler catches type mistakes before the program ever runs. [S1]
## 📖 세부 내용 (Details)
- All 5 basic examples: `int myNum = 5; float myFloatNum = 5.99f; char myLetter = 'D'; boolean myBool = true; String myText = "Hello";`. [S1]
- Type-change error: `int myNum = 5; myNum = "Hello"; // Error: cannot assign a String to an int`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 이후 Numbers/Booleans/Characters 챕터에서 각 타입이 상세히 다뤄지고, Type Casting 챕터에서 타입 변환 방법이 다뤄진다. [S1]
## 💻 코드 패턴 (Code patterns)
Type permanence enforced by the compiler (Java):
```java
int myNum = 5; // myNum is an int
// myNum = "Hello"; // Error: cannot assign a String to an int
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Variables]], [[Java Numbers]], [[Java Type Casting]]
- **참조 맥락:** 8개 원시 타입과 비원시 타입의 구분 — 정적 타이핑 안전성의 핵심 문서.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Data Types — https://www.w3schools.com/java/java_data_types.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Data Types" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,66 @@
---
id: java-data-types-real-life
title: "Java Data Types Real Life"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 자료형 실전 예제"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.86
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "datatypes", "real-life"]
raw_sources: ["https://www.w3schools.com/java/java_data_types_reallife.asp"]
applied_in: []
github_commit: ""
---
# [[Java Data Types Real Life]]
## 🎯 한 줄 통찰 (One-line insight)
A realistic calculation mixes int, float, and char in one program — multiplying an int by a float promotes the result to float automatically, then concatenating a char currency symbol shows how types blend when building output strings. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Mixed-type calculation** — `float totalCost = items * costPerItem;` combines `int` and `float` operands; the result is `float`. [S1]
- **char in string concatenation** — `costPerItem + currency` appends the char symbol to the printed line. [S1]
## 📖 세부 내용 (Details)
- Full example: `int items = 50; float costPerItem = 9.99f; float totalCost = items * costPerItem; char currency = '$'; System.out.println("Total cost = " + totalCost + currency);`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 여러 자료형을 조합한 총액 계산은 실무에서 흔한 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Mixed int/float calculation with char output (Java):
```java
int items = 50;
float costPerItem = 9.99f;
float totalCost = items * costPerItem;
char currency = '$';
System.out.println("Total cost = " + totalCost + currency);
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.86
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Data Types]], [[Java Numbers]], [[Java Characters]]
- **참조 맥락:** int/float/char를 조합한 실전 계산 예제.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Data Types Example — https://www.w3schools.com/java/java_data_types_reallife.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Data Types Example" page (Astra wiki-curation, P-Reinforce v3.1 format).
+76
View File
@@ -0,0 +1,76 @@
---
id: java-date
title: "Java Date"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["java.time package", "자바 날짜와 시간"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "date", "time", "java.time"]
raw_sources: ["https://www.w3schools.com/java/java_date.asp"]
applied_in: []
github_commit: ""
---
# [[Java Date]]
## 🎯 한 줄 통찰 (One-line insight)
Java has NO built-in Date class of its own — dates/times require importing the `java.time` package (LocalDate/LocalTime/LocalDateTime/DateTimeFormatter), a design choice the tutorial states upfront rather than assuming a language-level date type. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`java.time` package** — required import for all date/time functionality. [S1]
- **`LocalDate`** — represents a date only (`yyyy-MM-dd`). [S1]
- **`LocalTime`** — represents a time only (`HH-mm-ss-ns`). [S1]
- **`LocalDateTime`** — combines both date and time. [S1]
- **`DateTimeFormatter`** — formats/parses date-time objects via `ofPattern(...)`. [S1]
- **`.now()`** — static method on LocalDate/LocalTime/LocalDateTime returning the current value. [S1]
- **The "T" separator** — LocalDateTime's default string form uses "T" to separate date from time; removable via formatting. [S1]
## 📖 세부 내용 (Details)
- Current date: `LocalDate myObj = LocalDate.now(); // 2026-07-04`. [S1]
- Current time: `LocalTime myObj = LocalTime.now(); // 9:58:29.366162`. [S1]
- Current date+time: `LocalDateTime myObj = LocalDateTime.now(); // 2026-07-04T09:58:29.366392`. [S1]
- Custom formatting: `DateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm:ss"); String formattedDate = myDateObj.format(myFormatObj); // 04-07-2026 09:58:29`. [S1]
- Pattern examples: `yyyy-MM-dd` → "1988-09-29"; `dd/MM/yyyy` → "29/09/1988"; `dd-MMM-yyyy` → "29-Sep-1988"; `E, MMM dd yyyy` → "Thu, Sep 29 1988". [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 로그 타임스탬프, 사용자 표시용 날짜 포맷 변환의 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Custom date-time formatting (Java):
```java
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
LocalDateTime myDateObj = LocalDateTime.now();
DateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm:ss");
String formattedDate = myDateObj.format(myFormatObj);
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Packages]], [[Java User Input]], [[Java Errors]]
- **참조 맥락:** java.time 패키지를 통한 날짜/시간 처리 — 에러/예외 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Date and Time — https://www.w3schools.com/java/java_date.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Date and Time" page (Astra wiki-curation, P-Reinforce v3.1 format).
+71
View File
@@ -0,0 +1,71 @@
---
id: java-debugging
title: "Java Debugging"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 디버깅"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "debugging"]
raw_sources: ["https://www.w3schools.com/java/java_debugging.asp"]
applied_in: []
github_commit: ""
---
# [[Java Debugging]]
## 🎯 한 줄 통찰 (One-line insight)
Print-statement debugging doubles as a crash locator — placing `println` calls before and after a suspect line (like a division) reveals exactly which line crashed, since the source shows "Before division" printing successfully while the line after the crash never executes at all. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Debugging** — identifying and fixing errors/bugs; involves reading error messages, tracing variable values, testing code in isolation. [S1]
- **Print-statement debugging** — the most basic technique: `System.out.println()` to check values and program flow. [S1]
- **Bracketing suspect code** — print before AND after a risky line to isolate exactly where a crash happens. [S1]
- **Variable-value checking** — print variable values to verify conditions behave as expected. [S1]
- **IDE debuggers** — breakpoints, step-through execution, real-time variable inspection (IntelliJ, Eclipse, NetBeans). [S1]
- **Debugging checklist** — read full error messages, check variable initialization, print to trace, watch for off-by-one errors, comment out code sections to isolate bugs. [S1]
## 📖 세부 내용 (Details)
- Crash isolation via print bracketing: `System.out.println("Before division"); int result = x / y; System.out.println("Result: " + result); // never runs`. [S1]
- Condition verification: `int age = 17; System.out.println("Age: " + age); if (age >= 18) {...} else {...}` — test by changing age to 18/19 and observing output. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — print 문으로 크래시 지점을 특정하는 기법은 예외 처리(Try Catch) 학습 전 단계의 기초 디버깅 방법이다. [S1]
## 💻 코드 패턴 (Code patterns)
Bracketing a suspect line with print statements to locate a crash (Java):
```java
int x = 10;
int y = 0;
System.out.println("Before division"); // prints
int result = x / y; // crashes here
System.out.println("Result: " + result); // never runs
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Errors]], [[Java Try Catch]]
- **참조 맥락:** 에러 발견 후 디버깅 기법 — 예외 처리(try-catch) 챕터로 직접 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Debugging — https://www.w3schools.com/java/java_debugging.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Debugging" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,69 @@
---
id: java-do-while-loop
title: "Java Do While Loop"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["do-while loop", "자바 do-while 반복문"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "loops", "do-while"]
raw_sources: ["https://www.w3schools.com/java/java_while_loop_do.asp"]
applied_in: []
github_commit: ""
---
# [[Java Do While Loop]]
## 🎯 한 줄 통찰 (One-line insight)
The do/while loop's defining trait is executing the body BEFORE the first condition check — even with `int i = 10; do {...} while (i < 5);`, the false-from-the-start condition still lets the body run exactly once, the exact opposite of a plain while loop. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`do { ... } while (condition);`** — runs the block once, then repeats while the condition holds. [S1]
- **Required semicolon** — the `;` after `while (condition)` is mandatory. [S1]
- **Guaranteed first run** — unlike `while`, the body always executes at least once, regardless of the initial condition. [S1]
- **Use case** — anything that must happen at least once, e.g. showing a message or prompting for input. [S1]
## 📖 세부 내용 (Details)
- Basic do/while: `int i = 0; do { System.out.println(i); i++; } while (i < 5);`. [S1]
- False-from-start still runs once: `int i = 10; do { System.out.println("i is " + i); i++; } while (i < 5);` — prints once despite the condition being false immediately. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **while 루프와의 핵심 차이**: while은 조건이 처음부터 거짓이면 아예 실행되지 않지만, do/while은 최소 한 번은 실행된다는 점이 명시적으로 대비됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 사용자 입력 프롬프트, 메뉴 표시 등 "최소 1회 실행" 이 필요한 상황에 사용된다. [S1]
## 💻 코드 패턴 (Code patterns)
Do/while always runs once, even with a false-from-start condition (Java):
```java
int i = 10;
do {
System.out.println("i is " + i);
i++;
} while (i < 5);
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java While Loop]], [[Java For Loop]]
- **참조 맥락:** while 루프의 변형 — 최소 1회 실행 보장이 핵심 차이.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Do/While Loop — https://www.w3schools.com/java/java_while_loop_do.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Do/While Loop" page (Astra wiki-curation, P-Reinforce v3.1 format).
+69
View File
@@ -0,0 +1,69 @@
---
id: java-else
title: "Java Else"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["else statement", "자바 else"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "conditions", "else"]
raw_sources: ["https://www.w3schools.com/java/java_conditions_else.asp"]
applied_in: []
github_commit: ""
---
# [[Java Else]]
## 🎯 한 줄 통찰 (One-line insight)
A stray semicolon after `if (condition)` silently breaks an if/else pair — the source explicitly warns that `if (condition);` ends the statement early, making the following `else` behave unexpectedly (or fail to compile as attached to that if). [S1]
## 🧠 핵심 개념 (Core concepts)
- **`else`** — runs a block only when the paired `if` condition is false; else itself carries no condition. [S1]
- **Syntax** — `if (condition) { ... } else { ... }`. [S1]
- **No semicolon after if(condition)** — doing so ends the if-statement prematurely and breaks the else pairing. [S1]
## 📖 세부 내용 (Details)
- Basic else: `boolean isRaining = false; if (isRaining) { System.out.println("Bring an umbrella!"); } else { System.out.println("No rain today, no need for an umbrella!"); }`. [S1]
- Time-based greeting: `int time = 20; if (time < 18) { System.out.println("Good day."); } else { System.out.println("Good evening."); } // Outputs "Good evening."`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **세미콜론 함정**: `if (condition)` 뒤에 세미콜론을 붙이면 안 된다는 점이 소스에서 별도 Notes로 강조됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 시간대별 인사말, 비/우산 여부 등 이진 분기의 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Binary branch with else (Java):
```java
int time = 20;
if (time < 18) {
System.out.println("Good day.");
} else {
System.out.println("Good evening.");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java If Else]], [[Java Else If]]
- **참조 맥락:** if의 false 분기 처리 — else if로 다중 조건 분기 확장.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Else — https://www.w3schools.com/java/java_conditions_else.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Else" page (Astra wiki-curation, P-Reinforce v3.1 format).
+72
View File
@@ -0,0 +1,72 @@
---
id: java-else-if
title: "Java Else If"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["else if statement", "자바 else if"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "conditions", "else-if"]
raw_sources: ["https://www.w3schools.com/java/java_conditions_elseif.asp"]
applied_in: []
github_commit: ""
---
# [[Java Else If]]
## 🎯 한 줄 통찰 (One-line insight)
An `else if` chain short-circuits at the first true condition — later conditions are never even evaluated, so ordering matters (e.g., a `time < 18` check placed before a `time < 12` check would incorrectly swallow morning cases). [S1]
## 🧠 핵심 개념 (Core concepts)
- **`else if`** — tests a new condition only if the preceding if/else-if was false. [S1]
- **Syntax** — `if (condition1) {...} else if (condition2) {...} else {...}`. [S1]
- **Chain evaluation** — conditions are checked top-to-bottom; the first true one wins and the rest are skipped. [S1]
## 📖 세부 내용 (Details)
- Weather example: `int weather = 2; if (weather == 1) {...} else if (weather == 2) { System.out.println("Wear sunglasses."); } else {...} // Outputs "Wear sunglasses."`. [S1]
- Time-of-day chain: `int time = 16; if (time < 12) {...} else if (time < 18) { System.out.println("Good day."); } else {...} // Outputs "Good day."`. [S1]
- Falls through to final else: `int time = 22;` with the same chain outputs `"Good evening."` since neither earlier condition matches. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 셋 이상의 분기가 필요한 다중 조건 판단(시간대, 온도, 등급 등)의 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Three-way branch chain (Java):
```java
int time = 16;
if (time < 12) {
System.out.println("Good morning.");
} else if (time < 18) {
System.out.println("Good day.");
} else {
System.out.println("Good evening.");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Else]], [[Java If Shorthand]], [[Java Switch]]
- **참조 맥락:** 다중 조건 분기 — switch문의 대안으로 쓰임.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Else If — https://www.w3schools.com/java/java_conditions_elseif.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Else If" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,76 @@
---
id: java-encapsulation
title: "Java Encapsulation"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["getters and setters", "자바 캡슐화"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "encapsulation", "getters-setters"]
raw_sources: ["https://www.w3schools.com/java/java_encapsulation.asp"]
applied_in: []
github_commit: ""
---
# [[Java Encapsulation]]
## 🎯 한 줄 통찰 (One-line insight)
Get/set methods give control beyond simple read/write access — the source explicitly notes you can make an attribute read-only (get method only, no set) or write-only (set method only, no get), a flexibility that direct public-field access can never provide. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Encapsulation** — hiding sensitive data from users by (1) declaring attributes `private` and (2) providing public get/set methods. [S1]
- **Naming convention** — `get`/`set` prefix + capitalized variable name (`getName()`, `setName()`). [S1]
- **Getter** — returns the private variable's value. [S1]
- **Setter** — takes a parameter and assigns it via `this.field = param;`. [S1]
- **Read-only/write-only design** — omit the setter for read-only, omit the getter for write-only. [S1]
## 📖 세부 내용 (Details)
- Private field with getter/setter: `private String name; public String getName() { return name; } public void setName(String newName) { this.name = newName; }`. [S1]
- Direct access fails: `myObj.name = "John"; // error: name has private access in Person`. [S1]
- Correct access via encapsulation: `myObj.setName("John"); System.out.println(myObj.getName()); // "John"`. [S1]
- Benefits listed: better control over attributes/methods, read-only/write-only capability, flexibility to change internals without affecting other code, increased data security. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — private 필드 + get/set 메서드는 데이터 보호의 표준 설계 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Private field with getter/setter encapsulation (Java):
```java
public class Person {
private String name; // private = restricted access
public String getName() {
return name;
}
public void setName(String newName) {
this.name = newName;
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Modifiers]], [[Java This Keyword]], [[Java Packages]]
- **참조 맥락:** private 필드 보호 원칙 — Packages 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Encapsulation — https://www.w3schools.com/java/java_encapsulation.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Encapsulation" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,79 @@
---
id: java-enum-constructor
title: "Java Enum Constructor"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 열거형 생성자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "enums", "constructor"]
raw_sources: ["https://www.w3schools.com/java/java_enum_constructor.asp"]
applied_in: []
github_commit: ""
---
# [[Java Enum Constructor]]
## 🎯 한 줄 통찰 (One-line insight)
An enum constructor MUST be private — and uniquely, if you forget to write `private`, Java adds it automatically rather than erroring, since enum constants can only ever be created by the enum itself when the constants are declared, never by outside code. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Enum constructor** — runs automatically once for each constant when the enum is loaded; cannot be called manually. [S1]
- **Per-constant arguments** — `LOW("Low level"), MEDIUM("Medium level"), HIGH("High level");` passes a distinct value to the constructor for each constant. [S1]
- **Private-only constructor** — must be `private`; Java auto-adds it if omitted. [S1]
- **Getter for constant data** — a regular method (e.g. `getDescription()`) exposes the field set by the constructor. [S1]
- **Combines with `values()`** — looping via `values()` while also calling the getter on each constant. [S1]
## 📖 세부 내용 (Details)
- Enum with constructor and field: `enum Level { LOW("Low level"), MEDIUM("Medium level"), HIGH("High level"); private String description; private Level(String description) { this.description = description; } public String getDescription() { return description; } }`. [S1]
- Access: `Level myVar = Level.MEDIUM; System.out.println(myVar.getDescription()); // "Medium level"`. [S1]
- Loop with description: `for (Level myVar : Level.values()) { System.out.println(myVar + ": " + myVar.getDescription()); } // LOW: Low level / MEDIUM: Medium level / HIGH: High level`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **생성자의 private 강제성**: private을 명시하지 않아도 Java가 자동으로 추가한다는 점이 명시됨(다른 생성자 규칙과 차별화). [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 각 enum 상수에 설명 문자열을 부여하는 패턴은 상태 코드/레벨 표현의 실전 응용이다. [S1]
## 💻 코드 패턴 (Code patterns)
Enum with a private constructor assigning per-constant data (Java):
```java
enum Level {
LOW("Low level"),
MEDIUM("Medium level"),
HIGH("High level");
private String description;
private Level(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Enums]], [[Java Constructors]], [[Java User Input]]
- **참조 맥락:** enum에 생성자로 부가 데이터를 부여하는 패턴 — User Input & Date 섹션으로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Enum Constructor — https://www.w3schools.com/java/java_enum_constructor.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Enum Constructor" page (Astra wiki-curation, P-Reinforce v3.1 format).
+75
View File
@@ -0,0 +1,75 @@
---
id: java-enums
title: "Java Enums"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["enum keyword", "자바 열거형"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "enums"]
raw_sources: ["https://www.w3schools.com/java/java_enums.asp"]
applied_in: []
github_commit: ""
---
# [[Java Enums]]
## 🎯 한 줄 통찰 (One-line insight)
Enums can have attributes and methods just like classes, but with one key restriction that defines their whole purpose — enum constants are always `public`, `static`, and `final`, meaning you can never create an object from an enum or override its values, only select from a fixed listed set. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`enum`** — a special class representing a group of unchangeable constants. [S1]
- **Naming convention** — constants written in uppercase, comma-separated. [S1]
- **Dot-syntax access** — `Level myVar = Level.MEDIUM;`. [S1]
- **Enum inside a class** — enums can be nested inside a regular class. [S1]
- **Switch compatibility** — enums work naturally as switch expressions, with case labels matching constant names (no dot prefix in case labels). [S1]
- **`values()`** — built-in method returning an array of all enum constants, useful for looping. [S1]
- **Constraints vs. classes** — cannot instantiate objects from an enum; cannot extend other classes (but CAN implement interfaces). [S1]
## 📖 세부 내용 (Details)
- Basic enum: `enum Level { LOW, MEDIUM, HIGH } ... Level myVar = Level.MEDIUM;`. [S1]
- Switch on enum: `switch(myVar) { case LOW: ...; case MEDIUM: System.out.println("Medium level"); break; case HIGH: ...; }`. [S1]
- Loop via values(): `for (Level myVar : Level.values()) { System.out.println(myVar); } // LOW MEDIUM HIGH`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **불변성 제약**: enum 상수는 public, static, final이므로 객체 생성이 불가하고 값 재정의도 불가하다는 점이 명확히 구분됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 요일, 색상, 카드 덱처럼 값이 절대 바뀌지 않는 고정 집합을 표현할 때 사용된다. [S1]
## 💻 코드 패턴 (Code patterns)
Enum used in a switch statement (Java):
```java
enum Level { LOW, MEDIUM, HIGH }
Level myVar = Level.MEDIUM;
switch (myVar) {
case LOW: System.out.println("Low level"); break;
case MEDIUM: System.out.println("Medium level"); break;
case HIGH: System.out.println("High level"); break;
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Switch]], [[Java Enum Constructor]], [[Java Interface]]
- **참조 맥락:** 고정 상수 집합 표현 — 생성자를 갖는 enum(Enum Constructor)으로 확장.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Enums — https://www.w3schools.com/java/java_enums.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Enums" page (Astra wiki-curation, P-Reinforce v3.1 format).
+72
View File
@@ -0,0 +1,72 @@
---
id: java-errors
title: "Java Errors"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 에러 유형"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "errors"]
raw_sources: ["https://www.w3schools.com/java/java_errors.asp"]
applied_in: []
github_commit: ""
---
# [[Java Errors]]
## 🎯 한 줄 통찰 (One-line insight)
Logical errors are explicitly called "hardest to find" because the program compiles AND runs without crashing — it just produces wrong results (e.g., `x - y` instead of `x + y`), meaning no error message points you to the bug; only testing against expected output reveals it. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Compile-time error** — detected by the compiler, prevents the code from running (syntax/type issues). [S1]
- **Runtime error** — occurs while running, often causes crashes (e.g., division by zero, out-of-bounds access). [S1]
- **Logical error** — code runs and produces output, but the output is wrong; hardest category to detect. [S1]
- **Good habits** — meaningful variable names, reading error messages for line numbers, checking for missing semicolons/braces, watching for typos. [S1]
## 📖 세부 내용 (Details)
- Missing semicolon: `int x = 5 System.out.println(x); // error: ';' expected`. [S1]
- Undeclared variable: `System.out.println(myVar); // cannot find symbol: variable myVar`. [S1]
- Mismatched types: `int x = "Hello"; // incompatible types: String cannot be converted to int`. [S1]
- Division by zero: `int x = 10; int y = 0; int result = x / y; // ArithmeticException: / by zero`. [S1]
- Array out of bounds: `int[] numbers = {1, 2, 3}; System.out.println(numbers[8]); // ArrayIndexOutOfBoundsException`. [S1]
- Logical error: `int sum = x - y;` when addition was intended — no exception thrown, just wrong output. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 세 가지 에러 유형 분류는 이후 디버깅/예외 처리 챕터의 기초 개념이다. [S1]
## 💻 코드 패턴 (Code patterns)
Logical error — code runs but result is wrong (Java):
```java
int x = 10;
int y = 2;
int sum = x - y; // mistakenly subtracts instead of adds
System.out.println("x + y = " + sum); // "x + y = 8" (expected 12)
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Debugging]], [[Java Try Catch]]
- **참조 맥락:** 에러 유형 분류(컴파일/런타임/논리) — 디버깅 챕터로 직접 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Errors — https://www.w3schools.com/java/java_errors.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Errors" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,73 @@
---
id: java-exceptions-multiple
title: "Java Exceptions Multiple"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["multiple catch blocks", "multi-catch", "자바 다중 예외"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "exceptions", "multi-catch"]
raw_sources: ["https://www.w3schools.com/java/java_exceptions_multiple.asp"]
applied_in: []
github_commit: ""
---
# [[Java Exceptions Multiple]]
## 🎯 한 줄 통찰 (One-line insight)
Catch block order is not cosmetic — putting the general `Exception` catch BEFORE a specific `ArithmeticException` catch means the specific catch becomes unreachable dead code, since the general catch matches everything first; specific exceptions must always precede general ones. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Multiple catch blocks** — one `try` can be followed by several `catch` blocks for different exception types. [S1]
- **First-match wins** — Java runs the FIRST catch block whose type matches the thrown exception; only one catch runs even if multiple errors would occur. [S1]
- **Ordering rule** — specific exceptions must come before general ones (`Exception` last), or the general catch silently swallows everything. [S1]
- **Multi-catch (`|`)** — since Java 7, catch several exception types in ONE block using `|`, avoiding duplicated handler code. [S1]
## 📖 세부 내용 (Details)
- Multiple catches, first match wins: `try { System.out.println(numbers[10]); int result = 10 / 0; } catch (ArrayIndexOutOfBoundsException e) { System.out.println("Array index does not exist."); } catch (ArithmeticException e) {...} catch (Exception e) {...}` — only the array exception fires since it happens first. [S1]
- Bad ordering (unreachable code): `catch (Exception e) {...} catch (ArithmeticException e) { /* never reached */ }`. [S1]
- Multi-catch with `|`: `catch (ArithmeticException | ArrayIndexOutOfBoundsException e) { System.out.println("Math error or array error occurred."); }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **catch 순서 규칙**: 일반적인 Exception을 먼저 두면 이후 구체적인 catch가 절대 도달하지 못한다는 점이 강하게 경고됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 같은 방식으로 처리할 여러 예외를 |로 묶는 multi-catch가 코드 중복을 줄이는 실전 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Multi-catch with the | symbol (Java, since Java 7):
```java
try {
int result = 10 / 0;
int[] numbers = {1, 2, 3};
System.out.println(numbers[10]);
}
catch (ArithmeticException | ArrayIndexOutOfBoundsException e) {
System.out.println("Math error or array error occurred.");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Try Catch]], [[Java Try Catch Resources]]
- **참조 맥락:** 여러 예외 타입 처리 — try-with-resources 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Multiple Exceptions — https://www.w3schools.com/java/java_exceptions_multiple.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Multiple Exceptions" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,75 @@
---
id: java-fileinputstream
title: "Java FileInputStream"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 FileInputStream"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "io", "fileinputstream", "byte-stream"]
raw_sources: ["https://www.w3schools.com/java/java_fileinputstream.asp"]
applied_in: []
github_commit: ""
---
# [[Java FileInputStream]]
## 🎯 한 줄 통찰 (One-line insight)
`FileInputStream.read()` returns `-1` (not an exception or null) to signal end-of-file — reading one raw byte at a time, this integer sentinel value is the loop-termination condition (`while ((i = input.read()) != -1)`), and any file type can be copied byte-for-byte using this same mechanism regardless of content. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`FileInputStream`** — reads raw bytes, giving full control beyond what Scanner offers; essential for binary data (images, audio, PDFs). [S1]
- **`.read()`** — returns one byte as an int, or `-1` at end-of-file. [S1]
- **Byte-to-char casting** — `(char) i` converts a byte to a printable character for text files. [S1]
- **Universal file copying** — pairing `FileInputStream` (read) with `FileOutputStream` (write) can copy ANY file type since it operates on raw bytes, not interpreted text. [S1]
## 📖 세부 내용 (Details)
- Read text byte-by-byte: `try (FileInputStream input = new FileInputStream("filename.txt")) { int i; while ((i = input.read()) != -1) { System.out.print((char) i); } } catch (IOException e) {...}`. [S1]
- Copy a binary file: `try (FileInputStream input = new FileInputStream("image.jpg"); FileOutputStream output = new FileOutputStream("copy.jpg")) { int i; while ((i = input.read()) != -1) { output.write(i); } }`. [S1]
- Class choice guide: Scanner (simple text/parsing), BufferedReader (large text, line-by-line), FileInputStream (binary/raw byte control). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 이미지 파일(image.jpg → copy.jpg)을 바이트 단위로 복사하는 예제가 바이너리 데이터 처리의 대표 실전 사례다. [S1]
## 💻 코드 패턴 (Code patterns)
Copying any file type byte-by-byte (Java):
```java
try (FileInputStream input = new FileInputStream("image.jpg");
FileOutputStream output = new FileOutputStream("copy.jpg")) {
int i;
while ((i = input.read()) != -1) {
output.write(i);
}
System.out.println("File copied successfully.");
} catch (IOException e) {
System.out.println("Error handling file.");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java IO Streams]], [[Java FileOutputStream]], [[Java Files Read]]
- **참조 맥락:** 바이트 단위 파일 읽기 — FileOutputStream과 짝을 이루어 파일 복사에 사용.
## 📚 출처 (Sources)
- [S1] W3Schools — Java FileInputStream — https://www.w3schools.com/java/java_fileinputstream.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java FileInputStream" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,74 @@
---
id: java-fileoutputstream
title: "Java FileOutputStream"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 FileOutputStream"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "io", "fileoutputstream", "byte-stream"]
raw_sources: ["https://www.w3schools.com/java/java_fileoutputstream.asp"]
applied_in: []
github_commit: ""
---
# [[Java FileOutputStream]]
## 🎯 한 줄 통찰 (One-line insight)
`FileOutputStream` mirrors `FileWriter`'s API surface almost exactly (`.write()`, overwrite-by-default, `true` as second constructor arg for append) — the only real difference is that it writes raw bytes (`text.getBytes()`) instead of character text, which is what makes it usable for binary files where FileWriter cannot go. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`FileOutputStream`** — writes raw bytes; works for both text and binary data (images, PDFs, audio). [S1]
- **`.write(text.getBytes())`** — converts a String to bytes before writing. [S1]
- **Default overwrite behavior** — same as FileWriter: replaces existing file content. [S1]
- **Append mode** — pass `true` as the second constructor argument: `new FileOutputStream("filename.txt", true)`. [S1]
- **Byte-level file copying** — pairs with `FileInputStream` to copy any file type. [S1]
## 📖 세부 내용 (Details)
- Basic text write: `try (FileOutputStream output = new FileOutputStream("filename.txt")) { output.write(text.getBytes()); }`. [S1]
- Binary file copy: `try (FileInputStream input = new FileInputStream("image.jpg"); FileOutputStream output = new FileOutputStream("copy.jpg")) { int b; while ((b = input.read()) != -1) { output.write(b); } }`. [S1]
- Append mode: `try (FileOutputStream output = new FileOutputStream("filename.txt", true)) { output.write(text.getBytes()); }`. [S1]
- Class choice guide: FileWriter (basic text), BufferedWriter (large text, line handling), FileOutputStream (binary/raw byte control). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — FileInputStream과 짝을 이룬 이미지 파일 복사가 대표적 실전 응용이다. [S1]
## 💻 코드 패턴 (Code patterns)
Append mode with FileOutputStream (Java):
```java
String text = "\nAppended text!";
try (FileOutputStream output = new FileOutputStream("filename.txt", true)) { // true = append
output.write(text.getBytes());
System.out.println("Successfully appended to file.");
} catch (IOException e) {
System.out.println("Error writing file.");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java FileInputStream]], [[Java Files Write]], [[Java BufferedWriter]]
- **참조 맥락:** 바이트 단위 파일 쓰기 — FileInputStream과 짝을 이루어 파일 복사에 사용.
## 📚 출처 (Sources)
- [S1] W3Schools — Java FileOutputStream — https://www.w3schools.com/java/java_fileoutputstream.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java FileOutputStream" page (Astra wiki-curation, P-Reinforce v3.1 format).
+66
View File
@@ -0,0 +1,66 @@
---
id: java-files
title: "Java Files"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["File class", "자바 파일"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "files", "io"]
raw_sources: ["https://www.w3schools.com/java/java_files.asp"]
applied_in: []
github_commit: ""
---
# [[Java Files]]
## 🎯 한 줄 통찰 (One-line insight)
The `File` class itself only represents a file/directory REFERENCE and its metadata (`exists()`, `length()`, `canRead()`) — it doesn't read or write content directly, which is why separate classes (FileWriter, Scanner, etc.) handle actual content operations in later chapters. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`File` class** — from `java.io`; represents a file or directory reference. [S1]
- **Object creation** — `File myObj = new File("filename.txt");` — just specifies a path, doesn't create the file. [S1]
- **Metadata/info methods** — `canRead()`, `canWrite()`, `exists()`, `getName()`, `getAbsolutePath()`, `length()`, `list()`. [S1]
- **Action methods** — `createNewFile()`, `delete()`, `mkdir()`. [S1]
## 📖 세부 내용 (Details)
- Object creation: `import java.io.File; File myObj = new File("filename.txt");`. [S1]
- Method table: canRead()/canWrite() (boolean), createNewFile()/delete()/exists()/mkdir() (boolean), getName()/getAbsolutePath() (String), length() (long), list() (String[]). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — File 클래스는 이후 Create/Write/Read/Delete 챕터의 공통 기반이다. [S1]
## 💻 코드 패턴 (Code patterns)
Creating a File object reference (Java):
```java
import java.io.File;
File myObj = new File("filename.txt");
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Files Create]], [[Java Files Write]], [[Java Files Read]], [[Java Files Delete]]
- **참조 맥락:** File 클래스는 파일 조작 4단계(생성/쓰기/읽기/삭제)의 공통 기반이다.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Files — https://www.w3schools.com/java/java_files.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Files" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,75 @@
---
id: java-files-create
title: "Java Files Create"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["createNewFile()", "자바 파일 생성"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "files", "io", "create"]
raw_sources: ["https://www.w3schools.com/java/java_files_create.asp"]
applied_in: []
github_commit: ""
---
# [[Java Files Create]]
## 🎯 한 줄 통찰 (One-line insight)
`createNewFile()` returns `false` (not an exception) when the file already exists — only genuine I/O failures throw `IOException` — so checking the boolean return value, not just wrapping in try/catch, is how you distinguish "already exists" from "created successfully". [S1]
## 🧠 핵심 개념 (Core concepts)
- **`createNewFile()`** — returns `true` if created, `false` if the file already exists. [S1]
- **Must be wrapped in try/catch** — throws `IOException` if the file cannot be created for other reasons. [S1]
- **Empty file only** — creates a file with no content; writing content is a separate chapter. [S1]
- **Path escaping** — Windows paths need double backslashes (`"C:\\Users\\MyName\\filename.txt"`); Mac/Linux use plain forward-slash paths. [S1]
## 📖 세부 내용 (Details)
- Create with result check: `try { File myObj = new File("filename.txt"); if (myObj.createNewFile()) { System.out.println("File created: " + myObj.getName()); } else { System.out.println("File already exists."); } } catch (IOException e) { System.out.println("An error occurred."); e.printStackTrace(); }`. [S1]
- Specific folder (Windows escaping): `File myObj = new File("C:\\Users\\MyName\\filename.txt");`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 파일 존재 여부를 boolean 반환값으로 구분하는 패턴이 이후 Write 챕터로 이어진다. [S1]
## 💻 코드 패턴 (Code patterns)
Creating a file with existence check (Java):
```java
try {
File myObj = new File("filename.txt");
if (myObj.createNewFile()) {
System.out.println("File created: " + myObj.getName());
} else {
System.out.println("File already exists.");
}
} catch (IOException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Files]], [[Java Files Write]], [[Java Try Catch]]
- **참조 맥락:** 빈 파일 생성 — 내용을 쓰는 Write 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Create Files — https://www.w3schools.com/java/java_files_create.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Create Files" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,68 @@
---
id: java-files-delete
title: "Java Files Delete"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["delete()", "자바 파일 삭제"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "files", "io", "delete"]
raw_sources: ["https://www.w3schools.com/java/java_files_delete.asp"]
applied_in: []
github_commit: ""
---
# [[Java Files Delete]]
## 🎯 한 줄 통찰 (One-line insight)
`delete()` works identically on files AND directories, but folders must be EMPTY first — the same method call (`myObj.delete()`) succeeds on a populated file yet fails on a non-empty directory, with no separate API for the two cases. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`delete()`** — deletes a file, or an empty folder; returns `true`/`false` for success/failure. [S1]
- **Folder deletion constraint** — a directory must be empty before it can be deleted with `delete()`. [S1]
## 📖 세부 내용 (Details)
- Delete file: `File myObj = new File("filename.txt"); if (myObj.delete()) { System.out.println("Deleted the file: " + myObj.getName()); } else { System.out.println("Failed to delete the file."); }`. [S1]
- Delete folder (must be empty): `File myObj = new File("C:\\Users\\MyName\\Test"); if (myObj.delete()) { System.out.println("Deleted the folder: " + myObj.getName()); }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **폴더 삭제 제약**: 폴더가 비어있어야만 delete()로 삭제 가능하다는 점이 명시됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — File/Create/Write/Read/Delete 4단계 챕터의 마지막 단계로, 파일 생명주기 관리를 완성한다. [S1]
## 💻 코드 패턴 (Code patterns)
Deleting a file with success check (Java):
```java
File myObj = new File("filename.txt");
if (myObj.delete()) {
System.out.println("Deleted the file: " + myObj.getName());
} else {
System.out.println("Failed to delete the file.");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Files Read]], [[Java Files]], [[Java IO Streams]]
- **참조 맥락:** 파일 생명주기(생성→쓰기→읽기→삭제)의 마지막 단계 — IO Streams 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Delete Files — https://www.w3schools.com/java/java_files_delete.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Delete Files" page (Astra wiki-curation, P-Reinforce v3.1 format).
+76
View File
@@ -0,0 +1,76 @@
---
id: java-files-read
title: "Java Files Read"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 파일 읽기"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "files", "io", "read", "scanner"]
raw_sources: ["https://www.w3schools.com/java/java_files_read.asp"]
applied_in: []
github_commit: ""
---
# [[Java Files Read]]
## 🎯 한 줄 통찰 (One-line insight)
Reading a file reuses the SAME `Scanner` class already learned for user input — just constructed from a `File` object instead of `System.in` — meaning the `hasNextLine()`/`nextLine()` looping pattern from console input transfers directly to file reading with no new API to learn. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`Scanner(File)`** — the same Scanner class from user-input chapters, now constructed from a File object. [S1]
- **Line-by-line loop** — `while (myReader.hasNextLine()) { String data = myReader.nextLine(); ... }`. [S1]
- **`FileNotFoundException`** — must be caught since the Scanner constructor can fail if the file doesn't exist. [S1]
- **try-with-resources** — Scanner auto-closes when used inside `try (...)`. [S1]
- **File metadata methods** — `exists()`, `getName()`, `getAbsolutePath()`, `canWrite()`, `canRead()`, `length()`. [S1]
- **Alternative read classes** — Scanner (simple text/parsing), BufferedReader (faster, line-by-line for large files), FileInputStream (binary data/raw bytes). [S1]
## 📖 세부 내용 (Details)
- Reading line by line: `File myObj = new File("filename.txt"); try (Scanner myReader = new Scanner(myObj)) { while (myReader.hasNextLine()) { String data = myReader.nextLine(); System.out.println(data); } } catch (FileNotFoundException e) { System.out.println("An error occurred."); }`. [S1]
- Get file info: `if (myObj.exists()) { System.out.println("File name: " + myObj.getName()); System.out.println("Absolute path: " + myObj.getAbsolutePath()); System.out.println("Writeable: " + myObj.canWrite()); System.out.println("Readable " + myObj.canRead()); System.out.println("File size in bytes " + myObj.length()); }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 앞서 작성한 filename.txt 내용을 다시 읽어 검증하는 흐름이 Create→Write→Read 챕터 연쇄의 실전 사례다. [S1]
## 💻 코드 패턴 (Code patterns)
Reading a file line by line with Scanner (Java):
```java
File myObj = new File("filename.txt");
try (Scanner myReader = new Scanner(myObj)) {
while (myReader.hasNextLine()) {
String data = myReader.nextLine();
System.out.println(data);
}
} catch (FileNotFoundException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Files Write]], [[Java Files Delete]], [[Java User Input]], [[Java BufferedReader]], [[Java FileInputStream]]
- **참조 맥락:** Scanner 재사용으로 파일 읽기 — Delete 챕터로 이어지며 BufferedReader/FileInputStream은 후속 심화.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Read Files — https://www.w3schools.com/java/java_files_read.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Read Files" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,73 @@
---
id: java-files-write
title: "Java Files Write"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["FileWriter", "자바 파일 쓰기"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "files", "io", "write", "filewriter"]
raw_sources: ["https://www.w3schools.com/java/java_files_write.asp"]
applied_in: []
github_commit: ""
---
# [[Java Files Write]]
## 🎯 한 줄 통찰 (One-line insight)
FileWriter OVERWRITES a file by default — appending requires explicitly passing `true` as a SECOND constructor argument (`new FileWriter("filename.txt", true)`), which is easy to miss since the single-argument constructor silently discards existing content. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`FileWriter`** — the simplest class for writing text to a file. [S1]
- **`.write(text)` + `.close()`** — writes then must manually close (or use try-with-resources). [S1]
- **Default behavior: overwrite** — an existing file's content is replaced unless append mode is used. [S1]
- **Append mode** — pass `true` as the second constructor argument: `new FileWriter("filename.txt", true)`. [S1]
- **Auto-creation** — if the file doesn't exist, Java creates it before appending. [S1]
- **Alternative write classes** — FileWriter (easiest, basic text), BufferedWriter (faster, better for large files), FileOutputStream (best for binary data). [S1]
## 📖 세부 내용 (Details)
- Basic write with manual close: `FileWriter myWriter = new FileWriter("filename.txt"); myWriter.write("Files in Java might be tricky, but it is fun enough!"); myWriter.close();`. [S1]
- Try-with-resources (auto-close): `try (FileWriter myWriter = new FileWriter("filename.txt")) { myWriter.write("..."); } catch (IOException e) {...}`. [S1]
- Append mode: `try (FileWriter myWriter = new FileWriter("filename.txt", true)) { myWriter.write("\nAppended text!"); }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **기본 동작이 덮어쓰기**: 추가(append)하려면 반드시 두 번째 인자로 true를 전달해야 한다는 점이 강조됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 로그 파일에 내용을 추가하는 등 append 모드는 실전에서 자주 쓰이는 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Append mode via the two-argument FileWriter constructor (Java):
```java
try (FileWriter myWriter = new FileWriter("filename.txt", true)) { // true = append
myWriter.write("\nAppended text!");
System.out.println("Successfully appended to the file.");
} catch (IOException e) {
System.out.println("An error occurred.");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Files Create]], [[Java Files Read]], [[Java BufferedWriter]], [[Java FileOutputStream]]
- **참조 맥락:** 파일에 텍스트 쓰기 — Read 챕터로 이어지며, BufferedWriter/FileOutputStream은 후속 챕터에서 심화.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Write To Files — https://www.w3schools.com/java/java_files_write.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Write To Files" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,67 @@
---
id: java-for-each-loop
title: "Java For Each Loop"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["for-each loop", "enhanced for loop", "자바 for-each"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "loops", "for-each", "arrays"]
raw_sources: ["https://www.w3schools.com/java/java_foreach_loop.asp"]
applied_in: []
github_commit: ""
---
# [[Java For Each Loop]]
## 🎯 한 줄 통찰 (One-line insight)
The for-each loop trades index-based flexibility for readability — you can't access a counter variable like `i < array.length`, but for pure "visit every element" iteration it eliminates the boilerplate of managing an index entirely. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`for (type variableName : arrayName) { ... }`** — iterates every element of an array without an explicit counter. [S1]
- **Exclusive to arrays/collections** — used specifically to loop through elements, not general counting loops. [S1]
- **Simpler and more readable** — no need for a counter comparison like `i < array.length`. [S1]
## 📖 세부 내용 (Details)
- String array: `String[] cars = {"Volvo", "BMW", "Ford", "Mazda"}; for (String car : cars) { System.out.println(car); }`. [S1]
- Int array: `int[] numbers = {10, 20, 30, 40}; for (int num : numbers) { System.out.println(num); }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 배열의 모든 원소를 순회 출력할 때 표준적으로 쓰이는 문법(Arrays 챕터에서 본격 확장됨). [S1]
## 💻 코드 패턴 (Code patterns)
For-each over a String array (Java):
```java
String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
for (String car : cars) {
System.out.println(car);
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java For Loop]], [[Java Arrays]], [[Java Arrays Loop]]
- **참조 맥락:** 배열 순회 전용 문법 — Arrays 챕터의 선행 개념.
## 📚 출처 (Sources)
- [S1] W3Schools — Java For Each Loop — https://www.w3schools.com/java/java_foreach_loop.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java For Each Loop" page (Astra wiki-curation, P-Reinforce v3.1 format).
+71
View File
@@ -0,0 +1,71 @@
---
id: java-for-loop
title: "Java For Loop"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["for loop", "자바 for 반복문"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "loops", "for"]
raw_sources: ["https://www.w3schools.com/java/java_for_loop.asp"]
applied_in: []
github_commit: ""
---
# [[Java For Loop]]
## 🎯 한 줄 통찰 (One-line insight)
Choose `for` over `while` specifically when the iteration count is known in advance — the tutorial frames this as the deciding factor between the two loop types, since a for loop bundles init/condition/increment into one line while while requires manual setup outside the loop. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`for (statement1; statement2; statement3) { ... }`** — statement1 runs once before the loop, statement2 is the continuation condition, statement3 runs after each iteration. [S1]
- **When to use for vs while** — for loop is preferred when the exact iteration count is known ahead of time. [S1]
- **False condition from the start** — like while, a for loop with a false initial condition skips the body entirely. [S1]
## 📖 세부 내용 (Details)
- Print 0-4: `for (int i = 0; i < 5; i++) { System.out.println(i); }`. [S1]
- Even numbers: `for (int i = 0; i <= 10; i = i + 2) { System.out.println(i); }`. [S1]
- Sum 1-5: `int sum = 0; for (int i = 1; i <= 5; i++) { sum = sum + i; } System.out.println("Sum is " + sum);`. [S1]
- Countdown: `for (int i = 5; i > 0; i--) { System.out.println(i); }`. [S1]
- Never runs: `for (int i = 10; i < 5; i++) { System.out.println("This will never be printed"); }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 합계 계산, 카운트다운 등 반복 횟수를 미리 아는 상황의 표준 도구다. [S1]
## 💻 코드 패턴 (Code patterns)
Sum accumulation with for loop (Java):
```java
int sum = 0;
for (int i = 1; i <= 5; i++) {
sum = sum + i;
}
System.out.println("Sum is " + sum);
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java While Loop]], [[Java For Loop Nested]], [[Java For Each Loop]], [[Java For Loop Real Life]]
- **참조 맥락:** 반복 횟수를 아는 경우의 표준 반복문 — 중첩/for-each로 확장됨.
## 📚 출처 (Sources)
- [S1] W3Schools — Java For Loop — https://www.w3schools.com/java/java_for_loop.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java For Loop" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,72 @@
---
id: java-for-loop-nested
title: "Java For Loop Nested"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["nested loops", "자바 중첩 반복문"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "loops", "nested"]
raw_sources: ["https://www.w3schools.com/java/java_for_loop_nested.asp"]
applied_in: []
github_commit: ""
---
# [[Java For Loop Nested]]
## 🎯 한 줄 통찰 (One-line insight)
Nested loop iteration counts multiply, not add — an outer loop running 2 times with an inner loop running 3 times each produces 6 total inner executions (2×3), a fact the source calls out explicitly in the code comments. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Nested loop** — placing one loop inside another; inner loop runs fully for each outer iteration. [S1]
- **Iteration multiplication** — total inner runs = outer count × inner count. [S1]
- **Use case** — tables, matrices, multi-dimensional data structures. [S1]
## 📖 세부 내용 (Details)
- Basic nesting: `for (int i = 1; i <= 2; i++) { System.out.println("Outer: " + i); for (int j = 1; j <= 3; j++) { System.out.println(" Inner: " + j); } } // Inner executes 6 times (2*3)`. [S1]
- Multiplication table: `for (int i = 1; i <= 3; i++) { for (int j = 1; j <= 3; j++) { System.out.print(i * j + " "); } System.out.println(); } // 1 2 3 / 2 4 6 / 3 6 9`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 구구단표, 행렬 등 2차원 데이터 순회의 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Multiplication table via nested for (Java):
```java
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 3; j++) {
System.out.print(i * j + " ");
}
System.out.println();
}
// 1 2 3
// 2 4 6
// 3 6 9
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java For Loop]], [[Java Arrays Multi]]
- **참조 맥락:** 행렬/테이블 등 2차원 순회 — 반복 횟수는 외부×내부로 곱해진다.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Nested Loops — https://www.w3schools.com/java/java_for_loop_nested.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Nested Loops" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,74 @@
---
id: java-for-loop-real-life
title: "Java For Loop Real Life"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 for 실전 예제"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "loops", "for", "examples"]
raw_sources: ["https://www.w3schools.com/java/java_for_loop_reallife.asp"]
applied_in: []
github_commit: ""
---
# [[Java For Loop Real Life]]
## 🎯 한 줄 통찰 (One-line insight)
The factorial example (`fact *= i` across `i = 1..n`) demonstrates for loops used for accumulation beyond simple sums — multiplicative accumulation is the same pattern as additive sum, just with `*=` instead of `+=` and a starting accumulator of 1 instead of 0. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Step-by-ten counting** — `i += 10` as a custom increment. [S1]
- **Even-number filter** — `i = i + 2` starting from 0. [S1]
- **Multiplication table generation** — nested logic inside a single loop using a fixed `number`. [S1]
- **Seat numbering** — straightforward 1-to-N labeling loop. [S1]
- **Factorial via multiplicative accumulator** — `fact *= i` starting from `fact = 1`. [S1]
## 📖 세부 내용 (Details)
- Count by tens: `for (int i = 0; i <= 100; i += 10) { System.out.println(i); }`. [S1]
- Even numbers: `for (int i = 0; i <= 10; i = i + 2) { System.out.println(i); }`. [S1]
- Multiplication table: `int number = 2; for (int i = 1; i <= 10; i++) { System.out.println(number + " x " + i + " = " + (number * i)); }`. [S1]
- Seat numbers: `for (int seat = 1; seat <= 5; seat++) { System.out.println("Seat number: " + seat); }`. [S1]
- Factorial: `int n = 5; int fact = 1; for (int i = 1; i <= n; i++) { fact *= i; } System.out.println("Factorial of " + n + " is " + fact); // 120`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 팩토리얼 계산(5! = 120)은 곱셈 누적기 패턴의 대표 예시다. [S1]
## 💻 코드 패턴 (Code patterns)
Factorial via multiplicative accumulator (Java):
```java
int n = 5;
int fact = 1;
for (int i = 1; i <= n; i++) {
fact *= i;
}
System.out.println("Factorial of " + n + " is " + fact); // 120
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java For Loop]], [[Java For Loop Nested]], [[Java Break Continue]]
- **참조 맥락:** for 루프의 실전 누적 계산 사례 — break/continue 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java For Loop Examples — https://www.w3schools.com/java/java_for_loop_reallife.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java For Loop Examples" page (Astra wiki-curation, P-Reinforce v3.1 format).
+77
View File
@@ -0,0 +1,77 @@
---
id: java-generics
title: "Java Generics"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 제네릭"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "generics"]
raw_sources: ["https://www.w3schools.com/java/java_generics.asp"]
applied_in: []
github_commit: ""
---
# [[Java Generics]]
## 🎯 한 줄 통찰 (One-line insight)
`<T extends Number>` bounds a generic to only numeric wrapper types specifically so `.doubleValue()` becomes callable inside the class — without that bound, `T` could be any type (including one with no `doubleValue()` method), so the bound isn't just a restriction, it's what makes the generic method's body compile at all. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Generics** — write classes/interfaces/methods that work across data types without fixing the type in advance. [S1]
- **Benefits** — code reusability (one class/method, many types), type safety (compile-time error catching), cleaner code (no manual casting). [S1]
- **Type parameter `<T>`** — a placeholder; becomes concrete (String, Integer, etc.) at usage site. [S1]
- **Generic class** — `class Box<T> { T value; ... }`. [S1]
- **Generic method** — `public static <T> void printArray(T[] array) { ... }`. [S1]
- **Bounded types** — `<T extends Number>` restricts T to Number subclasses, enabling numeric methods like `.doubleValue()` inside the class body. [S1]
- **Used internally by Collections** — `ArrayList<String>`, `HashMap<K,V>` are themselves generic. [S1]
## 📖 세부 내용 (Details)
- Generic class: `class Box<T> { T value; void set(T value) { this.value = value; } T get() { return value; } } ... Box<String> stringBox = new Box<>(); Box<Integer> intBox = new Box<>();`. [S1]
- Generic method: `public static <T> void printArray(T[] array) { for (T item : array) { System.out.println(item); } } ... printArray(names); printArray(numbers);`. [S1]
- Bounded generic: `class Stats<T extends Number> { T[] nums; double average() { double sum = 0; for (T num : nums) { sum += num.doubleValue(); } return sum / nums.length; } }` — works for both `Integer[]` and `Double[]`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — Integer/Double 배열 모두에 동작하는 평균 계산(Stats<T extends Number>)이 경계 제네릭의 대표 실전 사례다. [S1]
## 💻 코드 패턴 (Code patterns)
Bounded generic class computing average for any Number subtype (Java):
```java
class Stats<T extends Number> {
T[] nums;
Stats(T[] nums) { this.nums = nums; }
double average() {
double sum = 0;
for (T num : nums) { sum += num.doubleValue(); }
return sum / nums.length;
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Wrapper Classes]], [[Java ArrayList]], [[Java Annotations]]
- **참조 맥락:** 타입 안전한 재사용 가능 코드 — Annotations 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Generics — https://www.w3schools.com/java/java_generics.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Generics" page (Astra wiki-curation, P-Reinforce v3.1 format).
+74
View File
@@ -0,0 +1,74 @@
---
id: java-hashmap
title: "Java HashMap"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 HashMap"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "collections-framework", "hashmap"]
raw_sources: ["https://www.w3schools.com/java/java_hashmap.asp"]
applied_in: []
github_commit: ""
---
# [[Java HashMap]]
## 🎯 한 줄 통찰 (One-line insight)
Re-putting an existing key doesn't throw or create a duplicate entry — it silently OVERWRITES the previous value (`put("Norway", "Oslo")` twice just keeps one "Norway"→"Oslo" entry), which is the HashMap-specific version of the "keys must be unique" rule, distinct from HashSet's simple duplicate-ignore behavior since here the VALUE could actually change on overwrite. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`HashMap`** — key/value storage; access by key instead of index. [S1]
- **`put(key, value)`** — adds a new pair OR overwrites the value if the key already exists. [S1]
- **`get(key)`**, **`remove(key)`**, **`clear()`**, **`size()`** — standard operations, all key-based. [S1]
- **`keySet()`** vs. **`values()`** — iterate keys only, or values only, in a for-each loop. [S1]
- **Wrapper classes for primitive values** — same rule as ArrayList/HashSet. [S1]
## 📖 세부 내용 (Details)
- Overwrite on duplicate key: `capitalCities.put("Norway", "Oslo"); capitalCities.put("Norway", "Oslo"); // still one Norway entry — value overwritten, not duplicated`. [S1]
- Loop keys: `for (String i : capitalCities.keySet()) { System.out.println(i); }`. [S1]
- Loop values: `for (String i : capitalCities.values()) { System.out.println(i); }`. [S1]
- Loop keys+values: `for (String i : capitalCities.keySet()) { System.out.println("key: " + i + " value: " + capitalCities.get(i)); }`. [S1]
- Integer values: `HashMap<String, Integer> people = new HashMap<String, Integer>(); people.put("John", 32);`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **키 중복 시 값 덮어쓰기**: 같은 키로 다시 put()하면 이전 값이 최신 값으로 덮어써진다는 점이 명시됨(키는 반드시 유일해야 함). [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 국가-수도 매핑처럼 키로 값을 조회하는 것이 실전 활용의 대표 예시다. [S1]
## 💻 코드 패턴 (Code patterns)
Looping keys and values together (Java):
```java
HashMap<String, String> capitalCities = new HashMap<String, String>();
capitalCities.put("England", "London");
capitalCities.put("Norway", "Oslo");
for (String i : capitalCities.keySet()) {
System.out.println("key: " + i + " value: " + capitalCities.get(i));
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Map]], [[Java TreeMap]], [[Java LinkedHashMap]]
- **참조 맥락:** Map의 대표 구현체 — 정렬된 TreeMap 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java HashMap — https://www.w3schools.com/java/java_hashmap.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java HashMap" page (Astra wiki-curation, P-Reinforce v3.1 format).
+76
View File
@@ -0,0 +1,76 @@
---
id: java-hashset
title: "Java HashSet"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 HashSet"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "collections-framework", "hashset"]
raw_sources: ["https://www.w3schools.com/java/java_hashset.asp"]
applied_in: []
github_commit: ""
---
# [[Java HashSet]]
## 🎯 한 줄 통찰 (One-line insight)
Checking `numbers.contains(i)` for every value 1-10 against a HashSet with only {4, 7, 8} added demonstrates that HashSet's real strength is O(1)-style membership testing across a range — this "presence check across a range" pattern is a distinctly Set-shaped use case that ArrayList's linear `contains()` scan doesn't showcase as naturally. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`HashSet`** — a Set implementation where every element is unique; implements the `Set` interface. [S1]
- **Duplicate handling** — adding an already-present element is silently a no-op (no error, no duplicate). [S1]
- **`contains()`** — membership test. [S1]
- **Wrapper classes for primitives** — same rule as ArrayList: `Integer` for int, etc. [S1]
- **`var` keyword and Set-typed variable** — same patterns as List (`var cars = new HashSet<String>();`, `Set<String> cars = new HashSet<>();`). [S1]
## 📖 세부 내용 (Details)
- Duplicate ignored: `cars.add("BMW"); cars.add("BMW"); // only appears once`. [S1]
- Membership test across a range: `HashSet<Integer> numbers = new HashSet<Integer>(); numbers.add(4); numbers.add(7); numbers.add(8); for (int i = 1; i <= 10; i++) { if (numbers.contains(i)) { System.out.println(i + " was found in the set."); } else {...} }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 1~10 범위 내 값의 존재 여부를 검사하는 예제가 HashSet의 빠른 조회 특성을 보여주는 대표 사례다. [S1]
## 💻 코드 패턴 (Code patterns)
Fast membership check across a range with HashSet (Java):
```java
HashSet<Integer> numbers = new HashSet<Integer>();
numbers.add(4);
numbers.add(7);
numbers.add(8);
for (int i = 1; i <= 10; i++) {
if (numbers.contains(i)) {
System.out.println(i + " was found in the set.");
} else {
System.out.println(i + " was not found in the set.");
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Set]], [[Java TreeSet]], [[Java LinkedHashSet]], [[Java ArrayList]]
- **참조 맥락:** Set의 대표 구현체 — 정렬된 TreeSet 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java HashSet — https://www.w3schools.com/java/java_hashset.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java HashSet" page (Astra wiki-curation, P-Reinforce v3.1 format).
+61
View File
@@ -0,0 +1,61 @@
---
id: java-io-streams
title: "Java IO Streams"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["byte streams", "character streams", "자바 IO 스트림"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "io", "streams"]
raw_sources: ["https://www.w3schools.com/java/java_io_streams.asp"]
applied_in: []
github_commit: ""
---
# [[Java IO Streams]]
## 🎯 한 줄 통찰 (One-line insight)
The `File` class and I/O Streams solve completely different problems — `File` only inspects/manages files (existence, size, create/delete) but CANNOT read or write content, while streams (byte or character) are the only way to actually move data in or out of a file. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`File` class limitation** — provides metadata and file-management operations, but no content I/O. [S1]
- **Byte streams** — work with raw binary data (images, audio, PDFs); examples: `FileInputStream`, `FileOutputStream`. [S1]
- **Character streams** — work with text, automatically handling character encoding; examples: `FileReader`, `FileWriter`, `BufferedReader`, `BufferedWriter`. [S1]
- **Choosing rule** — character streams for text, byte streams for binary data. [S1]
## 📖 세부 내용 (Details)
- 이 챕터는 개념 분류 중심으로 별도 실행 코드 예제가 없음 — Byte Streams(FileInputStream/FileOutputStream)와 Character Streams(FileReader/FileWriter/BufferedReader/BufferedWriter)의 구분표를 제시. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 텍스트 vs 바이너리 데이터에 따라 스트림 종류를 선택하는 기준이 이후 FileInputStream/FileOutputStream/BufferedReader/BufferedWriter 챕터의 공통 분류 기준이다. [S1]
## 💻 코드 패턴 (Code patterns)
해당 챕터는 개념 소개 중심으로 별도 코드 예제가 없음 — 다음 챕터([[Java FileInputStream]])에서 바이트 스트림 실습이 시작된다.
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Files]], [[Java FileInputStream]], [[Java FileOutputStream]], [[Java BufferedReader]], [[Java BufferedWriter]]
- **참조 맥락:** File 클래스와 스트림의 역할 분리 — 바이트/문자 스트림 챕터들의 도입부.
## 📚 출처 (Sources)
- [S1] W3Schools — Java I/O Streams — https://www.w3schools.com/java/java_io_streams.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java I/O Streams" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,66 @@
---
id: java-identifiers
title: "Java Identifiers"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 식별자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "identifiers", "naming"]
raw_sources: ["https://www.w3schools.com/java/java_variables_identifiers.asp"]
applied_in: []
github_commit: ""
---
# [[Java Identifiers]]
## 🎯 한 줄 통찰 (One-line insight)
A valid Java identifier must start with a letter, `$`, or `_` (never a digit), contain no spaces, avoid reserved keywords, and is case-sensitive — with descriptive names strongly favored over terse ones for maintainability. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Identifier** — the unique name for a variable. [S1]
- **Naming rules** — letters, digits, underscores, `$` allowed; must begin with a letter (or `$`/`_`); no whitespace; case-sensitive; cannot be a reserved keyword. [S1]
- **Convention** — start with lowercase; descriptive names recommended for readability. [S1]
- **Invalid examples** — `2ndNumber` (starts with digit), `my var` (contains space), `int` (reserved keyword used as name). [S1]
## 📖 세부 내용 (Details)
- Good vs. terse naming: `int minutesPerHour = 60;` (clear) vs. `int m = 60;` (works, less clear). [S1]
- Invalid identifiers: `int 2ndNumber = 5;`, `int my var = 10;`, `int int = 20;` — all raise errors. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — Python Variable Names 챕터와 동일한 규칙 구조(문자/숫자 시작 제약, 대소문자 구분, 예약어 금지)를 공유한다. [S1]
## 💻 코드 패턴 (Code patterns)
Descriptive vs. terse naming (Java):
```java
int minutesPerHour = 60; // Good: clear intent
int m = 60; // OK, but less clear
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Variables]], [[Python Variable Names]]
- **참조 맥락:** 변수명 작성 규칙 — Python Variable Names와 유사한 구조.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Identifiers — https://www.w3schools.com/java/java_variables_identifiers.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Identifiers" page (Astra wiki-curation, P-Reinforce v3.1 format).
+79
View File
@@ -0,0 +1,79 @@
---
id: java-if-else
title: "Java If Else"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["if statement", "자바 조건문"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "conditions", "if"]
raw_sources: ["https://www.w3schools.com/java/java_conditions.asp"]
applied_in: []
github_commit: ""
---
# [[Java If Else]]
## 🎯 한 줄 통찰 (One-line insight)
Omitting curly braces after `if` is legal Java but dangerous — only the single next line belongs to the condition, so any subsequent line silently runs unconditionally, which is why the source explicitly recommends always using braces even for one-line bodies. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`if (condition) { ... }`** — executes a block only when the condition evaluates to true. [S1]
- **Condition must be boolean** — either a boolean expression (`x > y`) or a boolean variable (`isLightOn`). [S1]
- **Case sensitivity** — `if` must be lowercase; `If`/`IF` causes a compile error. [S1]
- **Boolean variable shorthand** — `if (isLightOn)` is equivalent to `if (isLightOn == true)` but shorter. [S1]
- **Braceless if** — a single-statement body can omit `{ }`, but only the immediately following line is conditional. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Braceless-if trap** — `if (x > y) System.out.println("a"); System.out.println("b");` runs `println("b")` unconditionally even though it looks indented under the if — the source calls this a "Potential Problem" and recommends ALWAYS using braces to prevent subtle bugs. [S1]
## 📖 세부 내용 (Details)
- Basic condition: `if (20 > 18) { System.out.println("20 is greater than 18"); }`. [S1]
- Variable comparison: `int x = 20; int y = 18; if (x > y) { System.out.println("x is greater than y"); }`. [S1]
- Equality check: `if (x == y) { System.out.println("x is equal to y"); }`. [S1]
- Boolean variable directly: `boolean isLightOn = true; if (isLightOn) { System.out.println("The light is on."); }`. [S1]
- Braceless (risky): `if (20 > 18) System.out.println("20 is greater than 18");`. [S1]
- Safe pattern: always wrap in `{ }`, even multi-statement blocks. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **소스가 직접 경고하는 함정**: 중괄호 생략 시 첫 줄만 조건에 속하고 이후 줄은 무조건 실행된다는 점. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — else/else if/switch로 이어지는 조건문 체계의 출발점이다. [S1]
## 💻 코드 패턴 (Code patterns)
Safe if with braces (Java):
```java
int x = 20;
int y = 18;
if (x > y) {
System.out.println("x is greater than y");
System.out.println("Both lines are part of the if");
}
System.out.println("I am outside if, not part of if!");
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Booleans]], [[Java Else]], [[Java Else If]], [[Java Switch]]
- **참조 맥락:** 조건문 체계의 시작점 — else, else if, switch로 이어진다.
## 📚 출처 (Sources)
- [S1] W3Schools — Java If ... Else — https://www.w3schools.com/java/java_conditions.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Conditions and If Statements" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,70 @@
---
id: java-if-shorthand
title: "Java If Shorthand"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["ternary operator", "자바 삼항 연산자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "conditions", "ternary"]
raw_sources: ["https://www.w3schools.com/java/java_conditions_shorthand.asp"]
applied_in: []
github_commit: ""
---
# [[Java If Shorthand]]
## 🎯 한 줄 통찰 (One-line insight)
The ternary operator can be nested to handle more than two outcomes (`(a) ? x : (b) ? y : z`), but the tutorial itself flags this as making code harder to read — a rare case of the source cautioning against a feature it just demonstrated. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Ternary operator** — `variable = (condition) ? expressionTrue : expressionFalse;`, called "ternary" because it takes three operands. [S1]
- **Purpose** — replaces simple if/else blocks with a single line. [S1]
- **Inline use** — can be used directly inside `System.out.println()` without a temp variable. [S1]
- **Nested ternary** — chains multiple `? :` for 3+ outcomes; readability trade-off explicitly noted. [S1]
- **Guidance** — use ternary for short/simple choices; prefer regular if...else for complex logic. [S1]
## 📖 세부 내용 (Details)
- Standard if/else: `int time = 20; if (time < 18) { System.out.println("Good day."); } else { System.out.println("Good evening."); }`. [S1]
- Ternary equivalent: `int time = 20; String result = (time < 18) ? "Good day." : "Good evening."; System.out.println(result);`. [S1]
- Inline ternary: `System.out.println((time < 18) ? "Good day." : "Good evening.");`. [S1]
- Nested ternary: `String message = (time < 12) ? "Good morning." : (time < 18) ? "Good afternoon." : "Good evening.";`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **가독성 경고**: 중첩 삼항 연산자를 소개하면서도 동시에 가독성을 해칠 수 있다고 경고 — 짧고 단순한 경우에만 사용 권장. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 간단한 이진 분기를 한 줄로 축약할 때 사용하는 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Ternary operator replacing if/else (Java):
```java
int time = 20;
String result = (time < 18) ? "Good day." : "Good evening.";
System.out.println(result);
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Else If]], [[Java If Else]]
- **참조 맥락:** 짧은 조건 분기의 축약형 — 복잡한 로직에는 부적합.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Short Hand If...Else (Ternary Operator) — https://www.w3schools.com/java/java_conditions_shorthand.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Short Hand If...Else" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,80 @@
---
id: java-inheritance
title: "Java Inheritance"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["subclass", "superclass", "extends keyword", "자바 상속"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "inheritance"]
raw_sources: ["https://www.w3schools.com/java/java_inheritance.asp"]
applied_in: []
github_commit: ""
---
# [[Java Inheritance]]
## 🎯 한 줄 통찰 (One-line insight)
The choice between `protected` and `private` on a parent attribute directly determines whether inheritance "works" for that field — the source deliberately uses `protected` on Vehicle's `brand` and notes that `private` would have blocked Car from accessing it at all. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Subclass (child)** — the class that inherits from another. [S1]
- **Superclass (parent)** — the class being inherited from. [S1]
- **`extends`** — keyword used to inherit from a class. [S1]
- **`protected`** — required (not `private`) if a subclass needs to access a parent attribute directly. [S1]
- **`final` on a class** — prevents any class from extending it; attempting to do so is a compile error. [S1]
- **Motivation** — code reusability: inherit attributes/methods of an existing class into a new one. [S1]
## 📖 세부 내용 (Details)
- Basic inheritance: `class Vehicle { protected String brand = "Ford"; public void honk() { System.out.println("Tuut, tuut!"); } } class Car extends Vehicle { private String modelName = "Mustang"; ... } ... myCar.honk(); myCar.brand + " " + myCar.modelName;`. [S1]
- Final class blocks inheritance: `final class Vehicle { ... } class Car extends Vehicle { ... } // error: cannot inherit from final Vehicle`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **protected 필수성**: brand가 private이었다면 Car 클래스가 접근할 수 없었을 것이라는 점이 명시적으로 강조됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — Vehicle→Car 상속 구조는 다형성(Polymorphism) 챕터의 직접적 전제가 된다. [S1]
## 💻 코드 패턴 (Code patterns)
Subclass inheriting a protected attribute and a method (Java):
```java
class Vehicle {
protected String brand = "Ford";
public void honk() {
System.out.println("Tuut, tuut!");
}
}
class Car extends Vehicle {
private String modelName = "Mustang";
public static void main(String[] args) {
Car myCar = new Car();
myCar.honk();
System.out.println(myCar.brand + " " + myCar.modelName);
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Modifiers]], [[Java Polymorphism]], [[Java Super Keyword]], [[Java Abstraction]]
- **참조 맥락:** 클래스 간 속성/메서드 재사용 — 다형성/super 키워드 챕터로 직접 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Inheritance (Subclass and Superclass) — https://www.w3schools.com/java/java_inheritance.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Inheritance" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,75 @@
---
id: java-inner-classes
title: "Java Inner Classes"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["nested classes", "자바 내부 클래스"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "inner-classes"]
raw_sources: ["https://www.w3schools.com/java/java_inner_classes.asp"]
applied_in: []
github_commit: ""
---
# [[Java Inner Classes]]
## 🎯 한 줄 통찰 (One-line insight)
A `static` inner class breaks the usual inner-class advantage — the source explicitly notes that unlike a regular (non-static) inner class, a static inner class does NOT have access to the outer class's members, trading outer-class access for the ability to instantiate without an outer object (`new OuterClass.InnerClass()` instead of `outer.new InnerClass()`). [S1]
## 🧠 핵심 개념 (Core concepts)
- **Inner (nested) class** — a class defined inside another class, grouping related classes for readability/maintainability. [S1]
- **Access syntax** — `OuterClass.InnerClass myInner = myOuter.new InnerClass();` requires an outer instance first. [S1]
- **Private inner class** — restricts access so outside code cannot instantiate it. [S1]
- **Static inner class** — instantiable without an outer object (`new OuterClass.InnerClass()`), but loses access to outer-class members. [S1]
- **Regular inner class can access outer members** — a non-static inner class's methods can read the outer class's attributes directly. [S1]
## 📖 세부 내용 (Details)
- Basic nesting: `class OuterClass { int x = 10; class InnerClass { int y = 5; } } ... OuterClass myOuter = new OuterClass(); OuterClass.InnerClass myInner = myOuter.new InnerClass(); System.out.println(myInner.y + myOuter.x); // 15`. [S1]
- Private inner class: `private class InnerClass { int y = 5; }` — accessing it from outside causes: `error: OuterClass.InnerClass has private access in OuterClass`. [S1]
- Static inner class: `static class InnerClass { int y = 5; } ... OuterClass.InnerClass myInner = new OuterClass.InnerClass(); // no outer instance needed`. [S1]
- Inner class accessing outer members: `class InnerClass { public int myInnerMethod() { return x; } }``x` belongs to the outer class, accessible from inside. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **static 내부 클래스의 트레이드오프**: 외부 객체 없이 인스턴스화 가능하지만, 외부 클래스 멤버에 접근할 수 없다는 점이 명시적으로 강조됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 관련 클래스를 논리적으로 묶어 가독성을 높이는 설계 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Inner class method accessing outer class attribute (Java):
```java
class OuterClass {
int x = 10;
class InnerClass {
public int myInnerMethod() {
return x;
}
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Classes]], [[Java Modifiers]], [[Java Abstraction]]
- **참조 맥락:** 클래스 내부에 클래스를 정의하는 구조 — 추상화(Abstraction) 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Inner Classes — https://www.w3schools.com/java/java_inner_classes.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Inner Classes" page (Astra wiki-curation, P-Reinforce v3.1 format).
+81
View File
@@ -0,0 +1,81 @@
---
id: java-interface
title: "Java Interface"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["implements keyword", "자바 인터페이스"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "interface"]
raw_sources: ["https://www.w3schools.com/java/java_interface.asp"]
applied_in: []
github_commit: ""
---
# [[Java Interface]]
## 🎯 한 줄 통찰 (One-line insight)
Interfaces exist specifically to work around Java's single-inheritance limitation — a class can only `extends` one superclass, but it can `implements` multiple interfaces (comma-separated), making interfaces Java's mechanism for something resembling multiple inheritance. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Interface** — a fully "abstract class" grouping related methods that all lack bodies. [S1]
- **`implements`** — the keyword a class uses to adopt an interface (vs. `extends` for classes). [S1]
- **Mandatory override** — implementing a class MUST override every method the interface declares. [S1]
- **Implicit modifiers** — interface methods are `abstract` + `public` by default; interface attributes are `public`, `static`, `final` by default. [S1]
- **No constructor** — interfaces cannot have constructors (can't be instantiated). [S1]
- **Multiple interfaces** — a class can implement several interfaces, separated by commas — Java's substitute for multiple inheritance. [S1]
## 📖 세부 내용 (Details)
- Interface declaration: `interface Animal { public void animalSound(); public void run(); }`. [S1]
- Implementation: `class Pig implements Animal { public void animalSound() { System.out.println("The pig says: wee wee"); } public void sleep() { System.out.println("Zzz"); } }`. [S1]
- Multiple interfaces: `class DemoClass implements FirstInterface, SecondInterface { public void myMethod() {...} public void myOtherMethod() {...} }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **다중 상속 대안**: Java는 클래스의 다중 상속을 지원하지 않지만, 인터페이스 다중 구현으로 유사 효과를 달성한다는 점이 명시됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 여러 인터페이스를 한 클래스가 동시에 구현하는 패턴이 다중 상속의 대체 수단으로 쓰인다. [S1]
## 💻 코드 패턴 (Code patterns)
Class implementing multiple interfaces (Java):
```java
interface FirstInterface {
public void myMethod();
}
interface SecondInterface {
public void myOtherMethod();
}
class DemoClass implements FirstInterface, SecondInterface {
public void myMethod() {
System.out.println("Some text..");
}
public void myOtherMethod() {
System.out.println("Some other text...");
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Abstraction]], [[Java Anonymous]], [[Java Enums]]
- **참조 맥락:** 다중 상속의 대안 — 익명 클래스 챕터에서 인터페이스를 즉석 구현하는 방법으로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Interface — https://www.w3schools.com/java/java_interface.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Interface" page (Astra wiki-curation, P-Reinforce v3.1 format).
+78
View File
@@ -0,0 +1,78 @@
---
id: java-intro
title: "Java Intro"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["Java Introduction", "자바 소개"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "basics"]
raw_sources: ["https://www.w3schools.com/java/java_intro.asp"]
applied_in: []
github_commit: ""
---
# [[Java Intro]]
## 🎯 한 줄 통찰 (One-line insight)
Java (1995, owned by Oracle, running on 3+ billion devices) is a platform-independent, object-oriented language whose syntactic closeness to C++/C# makes cross-language switching relatively easy. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Origin** — created in 1995, owned by Oracle. [S1]
- **Use cases** — mobile (especially Android), desktop, web applications, web/app servers, games, database connections. [S1]
- **Cross-platform** — runs on Windows, Mac, Linux, Raspberry Pi, etc. [S1]
- **Object-oriented** — gives programs clear structure and reusable code, lowering development cost. [S1]
- **Similarity to C++/C#** — makes switching between these languages easier. [S1]
- **Free and open-source**, with large community support. [S1]
## 📖 세부 내용 (Details)
- Hello World example: [S1]
```java
public class Main {
public static void main(String[] args) {
String name = "John";
System.out.println("Hello " + name);
}
}
```
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 이후 Syntax 챕터에서 이 Hello World 예제의 각 구성요소가 상세히 설명된다. [S1]
## 💻 코드 패턴 (Code patterns)
Hello World (Java):
```java
public class Main {
public static void main(String[] args) {
System.out.println("Hello " + "John");
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Syntax]], [[Java OOP]]
- **참조 맥락:** Java 튜토리얼 전체의 진입점.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Introduction — https://www.w3schools.com/java/java_intro.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Introduction" page (Astra wiki-curation, P-Reinforce v3.1 format).
+75
View File
@@ -0,0 +1,75 @@
---
id: java-iterator
title: "Java Iterator"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 이터레이터"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "collections-framework", "iterator"]
raw_sources: ["https://www.w3schools.com/java/java_iterator.asp"]
applied_in: []
github_commit: ""
---
# [[Java Iterator]]
## 🎯 한 줄 통찰 (One-line insight)
Removing elements while looping REQUIRES an Iterator's own `remove()` method — the source explicitly warns that a for loop or for-each loop would NOT work correctly for conditional removal, since the collection changes size mid-loop; only `Iterator.remove()` is designed to safely mutate the collection during iteration. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`Iterator`** — an object for looping through collections (ArrayList, HashSet, etc.); "iterating" = the technical term for looping. [S1]
- **`.iterator()`** — obtains an Iterator from any collection. [S1]
- **`hasNext()` / `next()`** — standard loop pattern: check then advance. [S1]
- **`remove()`** — Iterator-specific method that safely removes the current element DURING iteration. [S1]
- **Unsafe alternative** — for/for-each loops break when the collection's size changes mid-loop; only Iterator.remove() handles this correctly. [S1]
## 📖 세부 내용 (Details)
- Get iterator and print first: `Iterator<String> it = cars.iterator(); System.out.println(it.next());`. [S1]
- Full loop: `while(it.hasNext()) { System.out.println(it.next()); }`. [S1]
- Safe conditional removal: `ArrayList<Integer> numbers = ...; Iterator<Integer> it = numbers.iterator(); while(it.hasNext()) { Integer i = it.next(); if(i < 10) { it.remove(); } }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **for/for-each 루프의 위험성**: 컬렉션 순회 중 요소를 제거하려면 for 루프나 for-each 루프는 올바르게 동작하지 않는다는 점이 명시적으로 경고됨 — 반드시 Iterator.remove() 사용. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 10 미만의 숫자를 컬렉션에서 제거하는 예제가 순회 중 안전한 삭제의 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Safely removing elements during iteration (Java):
```java
ArrayList<Integer> numbers = new ArrayList<Integer>();
numbers.add(12); numbers.add(8); numbers.add(2); numbers.add(23);
Iterator<Integer> it = numbers.iterator();
while (it.hasNext()) {
Integer i = it.next();
if (i < 10) {
it.remove(); // safe removal during iteration
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java ArrayList]], [[Java HashSet]], [[Java For Each Loop]], [[Java Algorithms]]
- **참조 맥락:** 자료구조 공통 순회 도구 — Data Structures & Collections 섹션의 마지막, Advanced(알고리즘) 섹션으로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Iterator — https://www.w3schools.com/java/java_iterator.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Iterator" page (Astra wiki-curation, P-Reinforce v3.1 format).
+72
View File
@@ -0,0 +1,72 @@
---
id: java-lambda
title: "Java Lambda"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["lambda expressions", "자바 람다"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "lambda", "functional-interface"]
raw_sources: ["https://www.w3schools.com/java/java_lambda.asp"]
applied_in: []
github_commit: ""
---
# [[Java Lambda]]
## 🎯 한 줄 통찰 (One-line insight)
A lambda can only replace an anonymous class when the target interface is "functional" (exactly ONE abstract method) — the tutorial's own rule of thumb draws the line precisely there: lambda for short single-method interfaces, anonymous class when you need multiple methods, extra fields, or to extend a class. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Lambda expression** (Java 8+) — a short, nameless block of code taking parameters and returning a value. [S1]
- **Syntax** — `parameter -> expression`; multiple parameters need parentheses; complex bodies need `{ }` + explicit `return`. [S1]
- **Functional interface requirement** — a lambda's target type must be an interface with EXACTLY one abstract method. [S1]
- **Common use** — passed as arguments to methods like `ArrayList.forEach()`. [S1]
- **Built-in functional interfaces** — e.g. `Consumer<T>` from `java.util.function`. [S1]
- **Custom functional interfaces** — user-defined single-method interfaces work as lambda targets too. [S1]
- **Lambda vs. anonymous class rule of thumb** — lambda for short single-method interfaces; anonymous class for multiple methods/fields/extending a class. [S1]
## 📖 세부 내용 (Details)
- forEach with lambda: `numbers.forEach((n) -> { System.out.println(n); });`. [S1]
- Lambda stored in a variable (Consumer): `Consumer<Integer> method = (n) -> { System.out.println(n); }; numbers.forEach(method);`. [S1]
- Lambda as method parameter (custom functional interface): `interface StringFunction { String run(String str); } ... StringFunction exclaim = (s) -> s + "!"; printFormatted("Hello", exclaim);`. [S1]
- Same task via anonymous class vs. lambda: `Greeting g = new Greeting() { public void sayHello() {...} };` vs. `Greeting g = () -> System.out.println("Hello from lambda");`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **람다 사용의 전제 조건**: 대상 인터페이스가 반드시 함수형 인터페이스(추상 메서드 1개)여야 익명 클래스를 람다로 대체할 수 있다는 점이 규칙으로 명시됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — ArrayList.forEach()에 람다를 전달하는 패턴이 가장 흔한 실전 활용이다. [S1]
## 💻 코드 패턴 (Code patterns)
Lambda passed to forEach() (Java):
```java
ArrayList<Integer> numbers = new ArrayList<Integer>();
numbers.add(5); numbers.add(9); numbers.add(8); numbers.add(1);
numbers.forEach((n) -> { 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 Anonymous]], [[Java Interface]], [[Java Threads]], [[Java Advanced Sorting]]
- **참조 맥락:** 익명 클래스의 축약형 — 고급 정렬(Comparator 람다) 챕터로 직접 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Lambda Expressions — https://www.w3schools.com/java/java_lambda.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Lambda Expressions" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,70 @@
---
id: java-linkedhashmap
title: "Java LinkedHashMap"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 LinkedHashMap"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.89
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "collections-framework", "linkedhashmap"]
raw_sources: ["https://www.w3schools.com/java/java_linkedhashmap.asp"]
applied_in: []
github_commit: ""
---
# [[Java LinkedHashMap]]
## 🎯 한 줄 통찰 (One-line insight)
LinkedHashMap completes the exact same three-way pattern seen in the Set hierarchy (HashSet/TreeSet/LinkedHashSet) — HashMap (no order, fastest), TreeMap (sorted, slowest), LinkedHashMap (insertion order, middle ground) — showing Java's Collections Framework applies this identical order/speed trade-off symmetrically across both Set and Map implementations. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`LinkedHashMap`** — stores key-value pairs, preserving INSERTION order (not sorted order). [S1]
- **Same API as HashMap/TreeMap** — `put()`, `get()`, `remove()`, `clear()`, `size()`, `keySet()`, `values()`. [S1]
- **Duplicate key handling** — same as HashMap: re-putting an existing key overwrites its value silently. [S1]
- **Performance** — slightly slower than HashMap due to order tracking (same trade-off pattern as LinkedHashSet vs. HashSet). [S1]
## 📖 세부 내용 (Details)
- Insertion-order preservation: `LinkedHashMap<String, String> capitalCities = new LinkedHashMap<>(); capitalCities.put("England", "London"); capitalCities.put("India", "New Dehli"); ... // {England=London, India=New Dehli, Austria=Wien, Norway=Oslo, USA=Washington DC} — insertion order preserved`. [S1]
- Comparison table: HashMap (no order, faster random access) vs. LinkedHashMap (insertion order preserved, slightly slower). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 입력된 순서 그대로 국가-수도 목록을 유지해야 할 때 LinkedHashMap이 적합하다. [S1]
## 💻 코드 패턴 (Code patterns)
LinkedHashMap preserves insertion order (Java):
```java
LinkedHashMap<String, String> capitalCities = new LinkedHashMap<>();
capitalCities.put("England", "London");
capitalCities.put("India", "New Dehli");
capitalCities.put("Austria", "Wien");
System.out.println(capitalCities);
// {England=London, India=New Dehli, Austria=Wien}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.89
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java HashMap]], [[Java TreeMap]], [[Java Iterator]]
- **참조 맥락:** Map 구현체의 마지막 — Iterator 챕터로 이어짐(모든 자료구조 공통 순회 도구).
## 📚 출처 (Sources)
- [S1] W3Schools — Java LinkedHashMap — https://www.w3schools.com/java/java_linkedhashmap.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java LinkedHashMap" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,71 @@
---
id: java-linkedhashset
title: "Java LinkedHashSet"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 LinkedHashSet"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.89
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "collections-framework", "linkedhashset"]
raw_sources: ["https://www.w3schools.com/java/java_linkedhashset.asp"]
applied_in: []
github_commit: ""
---
# [[Java LinkedHashSet]]
## 🎯 한 줄 통찰 (One-line insight)
LinkedHashSet occupies the middle ground between HashSet and TreeSet — it preserves INSERTION order (not sorted order like TreeSet) at a smaller performance cost than TreeSet's full sorting overhead, making it the choice when you want predictable iteration order without paying for sorting. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`LinkedHashSet`** — unique elements, preserving insertion order (not sorted order). [S1]
- **Same API as HashSet/TreeSet** — `add()`, `contains()`, `remove()`, `clear()`, `size()`. [S1]
- **Duplicate handling** — ignored, same as HashSet/TreeSet. [S1]
- **Performance** — slightly slower than HashSet due to order tracking, but presumably faster than TreeSet's sorting (not directly compared in source). [S1]
## 📖 세부 내용 (Details)
- Insertion-order preservation: `LinkedHashSet<String> cars = new LinkedHashSet<>(); cars.add("Volvo"); cars.add("BMW"); cars.add("Ford"); cars.add("BMW"); cars.add("Mazda"); // [Volvo, BMW, Ford, Mazda] in insertion order`. [S1]
- Comparison table: HashSet (no order, faster) vs. LinkedHashSet (insertion order preserved, slightly slower). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 삽입 순서를 유지하면서 중복은 배제해야 하는 목록(방문 기록, 처리 순서 등)에 LinkedHashSet이 적합하다. [S1]
## 💻 코드 패턴 (Code patterns)
LinkedHashSet preserves insertion order (Java):
```java
LinkedHashSet<String> cars = new LinkedHashSet<>();
cars.add("Volvo");
cars.add("BMW");
cars.add("Ford");
cars.add("BMW"); // Duplicate, ignored
cars.add("Mazda");
System.out.println(cars); // [Volvo, BMW, Ford, Mazda]
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.89
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java HashSet]], [[Java TreeSet]], [[Java Map]]
- **참조 맥락:** Set 구현체의 마지막 — Map 인터페이스 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java LinkedHashSet — https://www.w3schools.com/java/java_linkedhashset.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java LinkedHashSet" page (Astra wiki-curation, P-Reinforce v3.1 format).
+70
View File
@@ -0,0 +1,70 @@
---
id: java-linkedlist
title: "Java LinkedList"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 LinkedList"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "collections-framework", "linkedlist"]
raw_sources: ["https://www.w3schools.com/java/java_linkedlist.asp"]
applied_in: []
github_commit: ""
---
# [[Java LinkedList]]
## 🎯 한 줄 통찰 (One-line insight)
ArrayList and LinkedList share the exact same List-interface methods (add/remove/set/clear) but have fundamentally different internal storage — ArrayList uses a real array that gets reallocated/copied when full, while LinkedList uses independently-linked "containers," which is why LinkedList is recommended for manipulation (insert/remove) while ArrayList wins for random access. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`LinkedList`** — nearly identical API to ArrayList; both implement `List`. [S1]
- **Internal difference: array vs. containers** — ArrayList grows by copying into a new larger array; LinkedList links independent containers together. [S1]
- **Use-case split** — ArrayList for storing/accessing data (random access); LinkedList for manipulating data (frequent insert/remove). [S1]
- **LinkedList-specific methods** — `addFirst()`, `addLast()`, `removeFirst()`, `removeLast()`, `getFirst()`, `getLast()`. [S1]
- **`var` keyword and List-typed variables** — same patterns as ArrayList (`var cars = new LinkedList<String>();`, `List<String> cars = new LinkedList<>();`). [S1]
## 📖 세부 내용 (Details)
- Basic creation: `LinkedList<String> cars = new LinkedList<String>(); cars.add("Volvo"); cars.add("BMW");`. [S1]
- Container-based internal structure: each container links to the next; adding an element creates a new container linked into the chain (contrasted with ArrayList's array-copy growth). [S1]
- LinkedList-specific methods: `addFirst()`, `addLast()`, `removeFirst()`, `removeLast()`, `getFirst()`, `getLast()`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **효율성 트레이드오프**: 무작위 접근이 잦으면 ArrayList가 더 효율적이지만, 특정 삽입/삭제 연산은 LinkedList 전용 메서드가 더 효율적이라는 점이 명시됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 데이터 접근이 목적이면 ArrayList, 데이터 조작(삽입/삭제)이 목적이면 LinkedList를 선택하는 것이 실전 가이드다. [S1]
## 💻 코드 패턴 (Code patterns)
LinkedList-specific first/last methods (Java):
```java
LinkedList<String> cars = new LinkedList<String>();
cars.add("Volvo");
cars.addFirst("Mazda"); // add to the beginning
cars.addLast("BMW"); // add to the end
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java ArrayList]], [[Java List]], [[Java Sort List]]
- **참조 맥락:** ArrayList의 대안 구현체 — 정렬(Sort List) 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java LinkedList — https://www.w3schools.com/java/java_linkedlist.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java LinkedList" page (Astra wiki-curation, P-Reinforce v3.1 format).
+62
View File
@@ -0,0 +1,62 @@
---
id: java-list
title: "Java List"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["List interface", "자바 리스트"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "collections-framework", "list"]
raw_sources: ["https://www.w3schools.com/java/java_list.asp"]
applied_in: []
github_commit: ""
---
# [[Java List]]
## 🎯 한 줄 통찰 (One-line insight)
`List` is an interface, so `new List<String>()` is impossible — you must always instantiate a CONCRETE implementer like `ArrayList` or `LinkedList`, a distinction that mirrors the abstract-class rule from the OOP section (cannot instantiate the abstraction itself). [S1]
## 🧠 핵심 개념 (Core concepts)
- **`List` interface** — ordered collection; supports index access, duplicates, and preserves insertion order. [S1]
- **Cannot instantiate directly** — must use an implementing class: `ArrayList` (resizable array, fast random access) or `LinkedList` (linked container chain, easy insert/remove). [S1]
- **Common methods** — `add()`, `get()`, `set()`, `remove()`, `size()`. [S1]
- **List vs. plain array** — array is fixed-size and not part of the Collections Framework; List implementations are dynamic-size and part of the framework. [S1]
## 📖 세부 내용 (Details)
- Method table: `add()` (append), `get()` (read by index), `set()` (replace by index), `remove()` (delete by index), `size()` (count). [S1]
- Comparison table: Array (fixed size, faster raw performance, not in Collections Framework) vs. List (dynamic size, more flexible/feature-rich, part of Collections Framework). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 순서와 중복을 허용해야 하는 데이터 저장에 List 인터페이스가 표준적으로 쓰인다. [S1]
## 💻 코드 패턴 (Code patterns)
해당 챕터는 개념/메서드표 중심으로 별도 실행 코드 예제가 없음 — 다음 챕터([[Java ArrayList]])에서 List 구현체 실습이 시작된다.
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Collections]], [[Java ArrayList]], [[Java LinkedList]]
- **참조 맥락:** List 인터페이스의 기초 — ArrayList/LinkedList 구현체 챕터로 직접 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java List Interface — https://www.w3schools.com/java/java_list.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java List Interface" page (Astra wiki-curation, P-Reinforce v3.1 format).
+61
View File
@@ -0,0 +1,61 @@
---
id: java-map
title: "Java Map"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["Map interface", "자바 맵"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "collections-framework", "map"]
raw_sources: ["https://www.w3schools.com/java/java_map.asp"]
applied_in: []
github_commit: ""
---
# [[Java Map]]
## 🎯 한 줄 통찰 (One-line insight)
The List/Set/Map comparison table reveals an asymmetric duplicate rule unique to Map — keys must be unique (like Set) but VALUES can duplicate freely (like List), meaning Map is the only structure of the three that enforces uniqueness on one part of its data while allowing duplication on the other. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`Map` interface** — stores key-value pairs; keys unique, values can repeat. [S1]
- **Implementing classes** — `HashMap` (fast, unordered), `TreeMap` (sorted by key), `LinkedHashMap` (insertion order). [S1]
- **Core methods** — `put()` (add/update), `get()` (retrieve by key), `remove()`, `containsKey()`, `keySet()` (all keys as a Set). [S1]
- **Three-way comparison** — List (duplicates yes, no key-value, ordered), Set (duplicates no, no key-value, unordered by default), Map (keys unique/values duplicate, key-value yes, unordered by default). [S1]
## 📖 세부 내용 (Details)
- Method table: put() (add/update), get() (retrieve by key), remove() (delete by key), containsKey() (key existence check), keySet() (returns all keys). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 사용자 ID와 이름을 연결하는 것처럼 고유 키에 값을 매핑할 때 Map이 표준적으로 쓰인다. [S1]
## 💻 코드 패턴 (Code patterns)
해당 챕터는 개념/비교표 중심으로 별도 실행 코드 예제가 없음 — 다음 챕터([[Java HashMap]])에서 Map 구현체 실습이 시작된다.
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Set]], [[Java HashMap]], [[Java TreeMap]], [[Java LinkedHashMap]]
- **참조 맥락:** Map 인터페이스의 기초 — HashMap/TreeMap/LinkedHashMap 구현체 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Map Interface — https://www.w3schools.com/java/java_map.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Map Interface" page (Astra wiki-curation, P-Reinforce v3.1 format).
+75
View File
@@ -0,0 +1,75 @@
---
id: java-math
title: "Java Math"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["Math class", "자바 수학"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "math"]
raw_sources: ["https://www.w3schools.com/java/java_math.asp"]
applied_in: []
github_commit: ""
---
# [[Java Math]]
## 🎯 한 줄 통찰 (One-line insight)
`Math.pow()` always returns a `double` even for whole-number results (`Math.pow(2,8)` gives `256.0`, not `256`), and `Math.random()` always returns a `double` in `[0.0, 1.0)`, requiring an explicit `(int)` cast plus scaling formula to get a bounded random integer. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`Math.max(x,y)` / `Math.min(x,y)`** — highest/lowest of two values. [S1]
- **`Math.sqrt(x)`** — square root. [S1]
- **`Math.abs(x)`** — absolute value. [S1]
- **`Math.pow(x,y)`** — x raised to power y; ALWAYS returns double. [S1]
- **Rounding methods** — `Math.round(x)` (nearest integer), `Math.ceil(x)` (round up), `Math.floor(x)` (round down). [S1]
- **`Math.random()`** — random double in `[0.0, 1.0)`. [S1]
- **Bounded random integer formula** — `(int)(Math.random() * 101)` for 0-100. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **pow() always returns double** — even `Math.pow(2, 8)` (a clean integer result) comes back as `256.0`, not `256` — a type consistency rule worth remembering when assigning the result to a variable. [S1]
- **random-int-in-range formula** — `(int)(Math.random() * (max+1))` scales the `[0,1)` double up to the desired range and truncates via cast — the standard idiom for bounded random integers. [S1]
## 📖 세부 내용 (Details)
- Max/min: `Math.max(5, 10); Math.min(5, 10);`. [S1]
- Square root/absolute: `Math.sqrt(64); Math.abs(-4.7);`. [S1]
- Power (always double): `Math.pow(2, 8); // 256.0`. [S1]
- Rounding: `Math.round(4.6); // 5`, `Math.ceil(4.1); // 5.0`, `Math.floor(4.9); // 4.0`. [S1]
- Bounded random int: `int randomNum = (int)(Math.random() * 101); // 0 to 100`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **pow()의 반환 타입**: 결과가 정수여도 항상 double을 반환한다는 점이 소스에서 명시적으로 강조됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 0~100 사이 난수 생성 공식은 게임/시뮬레이션에서 표준적으로 쓰인다. [S1]
## 💻 코드 패턴 (Code patterns)
Bounded random integer via cast (Java):
```java
int randomNum = (int)(Math.random() * 101); // 0 to 100
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Numbers]], [[Java Type Casting]], [[Python Math]]
- **참조 맥락:** 수학 계산의 기본 도구 — pow()의 double 반환, random() 범위 지정 공식이 핵심.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Math — https://www.w3schools.com/java/java_math.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Math" page (Astra wiki-curation, P-Reinforce v3.1 format).
+77
View File
@@ -0,0 +1,77 @@
---
id: java-methods
title: "Java Methods"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 메서드"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "methods"]
raw_sources: ["https://www.w3schools.com/java/java_methods.asp"]
applied_in: []
github_commit: ""
---
# [[Java Methods]]
## 🎯 한 줄 통찰 (One-line insight)
`static` on a method means it belongs to the CLASS itself, not to any object instance — a distinction the tutorial defers explaining fully until objects are introduced later, but flags immediately since every method example so far uses it. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Method** — a named, reusable block of code that runs only when called; also called a function. [S1]
- **Purpose** — code reuse: define once, use many times. [S1]
- **Declaration inside a class** — `static void myMethod() { ... }`. [S1]
- **`static`** — the method belongs to the class, not an object instance (elaborated later with OOP). [S1]
- **`void`** — signals no return value. [S1]
- **Calling** — `myMethod();` — can be called repeatedly. [S1]
## 📖 세부 내용 (Details)
- Definition: `public class Main { static void myMethod() { // code } }`. [S1]
- Call and output: `static void myMethod() { System.out.println("I just got executed!"); } public static void main(String[] args) { myMethod(); }`. [S1]
- Repeated calls: calling `myMethod();` three times inside main prints the message three times. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 코드 재사용의 기본 단위이며, 파라미터/반환값/오버로딩으로 확장된다. [S1]
## 💻 코드 패턴 (Code patterns)
Basic method definition and repeated call (Java):
```java
public class Main {
static void myMethod() {
System.out.println("I just got executed!");
}
public static void main(String[] args) {
myMethod();
myMethod();
myMethod();
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Methods Param]], [[Java Methods Return]], [[Java OOP]]
- **참조 맥락:** 코드 재사용의 기본 단위 — 파라미터/반환값 챕터로 확장.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Methods — https://www.w3schools.com/java/java_methods.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Methods" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,75 @@
---
id: java-methods-overloading
title: "Java Methods Overloading"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["method overloading", "자바 메서드 오버로딩"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "methods", "overloading"]
raw_sources: ["https://www.w3schools.com/java/java_methods_overloading.asp"]
applied_in: []
github_commit: ""
---
# [[Java Methods Overloading]]
## 🎯 한 줄 통찰 (One-line insight)
Method overloading is explicitly framed as the FIX for a code smell — the tutorial first shows two differently-named methods (`plusMethodInt`, `plusMethodDouble`) doing the same conceptual job, then demonstrates overloading them under one shared name (`plusMethod`) as the better design. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Method overloading** — multiple methods sharing the same name but differing in parameter number/type. [S1]
- **Compiler resolves by signature** — Java picks the right overload based on argument types/count at the call site. [S1]
- **Design motivation** — avoids duplicating near-identical methods with different names just to handle different types. [S1]
- **Rule** — same name is legal only if the number and/or type of parameters differs. [S1]
## 📖 세부 내용 (Details)
- Before overloading (bad pattern): `static int plusMethodInt(int x, int y) { return x + y; } static double plusMethodDouble(double x, double y) { return x + y; }`. [S1]
- After overloading (good pattern): `static int plusMethod(int x, int y) { return x + y; } static double plusMethod(double x, double y) { return x + y; }`. [S1]
- Usage: `int myNum1 = plusMethod(8, 5); double myNum2 = plusMethod(4.3, 6.26);` — the correct overload is chosen automatically based on argument types. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — int/double 등 타입별로 별도 메서드명을 두는 대신 오버로딩으로 통합하는 설계 개선 사례다. [S1]
## 💻 코드 패턴 (Code patterns)
Overloaded plusMethod for int and double (Java):
```java
static int plusMethod(int x, int y) {
return x + y;
}
static double plusMethod(double x, double y) {
return x + y;
}
public static void main(String[] args) {
int myNum1 = plusMethod(8, 5);
double myNum2 = plusMethod(4.3, 6.26);
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Methods Return]], [[Java Scope]], [[Java Recursion]]
- **참조 맥락:** 동일 이름의 메서드를 매개변수로 구분 — Scope/Recursion 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Method Overloading — https://www.w3schools.com/java/java_methods_overloading.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Method Overloading" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,73 @@
---
id: java-methods-param
title: "Java Methods Param"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["method parameters", "자바 메서드 매개변수"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "methods", "parameters"]
raw_sources: ["https://www.w3schools.com/java/java_methods_param.asp"]
applied_in: []
github_commit: ""
---
# [[Java Methods Param]]
## 🎯 한 줄 통찰 (One-line insight)
"Parameter" and "argument" are precisely distinguished, not used interchangeably — the parameter is the named variable in the method signature (`fname`), while the arguments are the actual values passed at call time (`"Liam"`, `"Jenny"`, `"Anja"`). [S1]
## 🧠 핵심 개념 (Core concepts)
- **Parameter** — a variable specified in the method's parentheses, acting like a local variable inside the method. [S1]
- **Argument** — the concrete value passed when calling the method. [S1]
- **Multiple parameters** — comma-separated, e.g. `(String fname, int age)`. [S1]
- **Order/count matching rule** — the call's arguments must match the parameter count and order exactly. [S1]
- **If/else inside methods** — a common pattern for validation-style methods. [S1]
## 📖 세부 내용 (Details)
- Single parameter: `static void myMethod(String fname) { System.out.println(fname + " Refsnes"); } ... myMethod("Liam"); // Liam Refsnes`. [S1]
- Multiple parameters: `static void myMethod(String fname, int age) { System.out.println(fname + " is " + age); } ... myMethod("Liam", 5); // Liam is 5`. [S1]
- If/else inside a method: `static void checkAge(int age) { if (age < 18) { System.out.println("Access denied..."); } else { System.out.println("Access granted..."); } } ... checkAge(20); // Access granted`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **매개변수 vs 인자 구분**: 정의부의 이름(매개변수)과 호출 시 전달되는 값(인자)을 명확히 구분한다는 점이 소스에서 강조됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 나이 체크(checkAge)처럼 조건 검증 로직을 메서드로 캡슐화하는 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Method with if/else validation logic (Java):
```java
static void checkAge(int age) {
if (age < 18) {
System.out.println("Access denied - You are not old enough!");
} else {
System.out.println("Access granted - You are old enough!");
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Methods]], [[Java Methods Return]], [[Java If Else]]
- **참조 맥락:** 메서드에 데이터를 전달하는 방법 — 반환값 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Method Parameters — https://www.w3schools.com/java/java_methods_param.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Method Parameters" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,73 @@
---
id: java-methods-return
title: "Java Methods Return"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["return statement", "자바 메서드 반환값"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "methods", "return"]
raw_sources: ["https://www.w3schools.com/java/java_methods_return.asp"]
applied_in: []
github_commit: ""
---
# [[Java Methods Return]]
## 🎯 한 줄 통찰 (One-line insight)
Storing a method's return value in a variable (`int z = myMethod(5, 3);`) is explicitly recommended over inlining it directly in `System.out.println()`, purely for readability/maintainability — both are functionally identical. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Return type replaces `void`** — using `int` instead of `void` signals the method returns a value. [S1]
- **`return` keyword** — sends a value back to the caller and ends method execution. [S1]
- **Return type must match a primitive type** — e.g., `int myMethod(int x) { return 5 + x; }`. [S1]
- **Storing vs. inlining the result** — assigning to a variable first is recommended for readability. [S1]
- **Loop + return combination** — calling a value-returning method repeatedly inside a for loop. [S1]
## 📖 세부 내용 (Details)
- Basic return: `static int myMethod(int x) { return 5 + x; } ... System.out.println(myMethod(3)); // 8`. [S1]
- Two-parameter sum: `static int myMethod(int x, int y) { return x + y; } ... myMethod(5, 3); // 8`. [S1]
- Stored in variable (recommended): `int z = myMethod(5, 3); System.out.println(z);`. [S1]
- Loop + return, "doubling game": `static int doubleGame(int x) { return x * 2; } for (int i = 1; i <= 5; i++) { System.out.println("Double of " + i + " is " + doubleGame(i)); }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 반복문 안에서 반환값 메서드를 호출하는 "더블링 게임" 예제가 실전 응용의 표본이다. [S1]
## 💻 코드 패턴 (Code patterns)
Value-returning method called inside a loop (Java):
```java
static int doubleGame(int x) {
return x * 2;
}
for (int i = 1; i <= 5; i++) {
System.out.println("Double of " + i + " is " + doubleGame(i));
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Methods Param]], [[Java Methods Overloading]], [[Java For Loop]]
- **참조 맥락:** void가 아닌 반환값을 갖는 메서드 — 오버로딩 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Return — https://www.w3schools.com/java/java_methods_return.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Return" page (Astra wiki-curation, P-Reinforce v3.1 format).
+67
View File
@@ -0,0 +1,67 @@
---
id: java-modifiers
title: "Java Modifiers"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["access modifiers", "자바 접근 제어자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "modifiers", "access-control"]
raw_sources: ["https://www.w3schools.com/java/java_modifiers.asp"]
applied_in: []
github_commit: ""
---
# [[Java Modifiers]]
## 🎯 한 줄 통찰 (One-line insight)
Classes only get two access modifier choices (`public`/default), while attributes/methods/constructors get four (`public`/`private`/default/`protected`) — the extra granularity for members exists because access control needs to operate at a finer level than whole-class visibility. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Access modifier** — controls the access level of classes, attributes, methods, constructors. [S1]
- **For classes** — `public` (accessible by any class) or `default` (package-only, used when no modifier is specified). [S1]
- **For members (attributes/methods/constructors)** — `public`, `private` (class-only), `default` (package-only), `protected` (package + subclasses). [S1]
- **Real-life analogy** — public = public park (anyone enters); private = house key (only you). [S1]
## 📖 세부 내용 (Details)
- Public vs. private: `class Person { public String name = "John"; private int age = 30; } ... p.name // works; p.age // Error: age has private access in Person`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — public/private 분리는 캡슐화(Encapsulation) 챕터의 직접적 기반이다. [S1]
## 💻 코드 패턴 (Code patterns)
Public vs. private attribute access (Java):
```java
class Person {
public String name = "John"; // accessible everywhere
private int age = 30; // only accessible inside this class
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Non Access Modifiers]], [[Java Encapsulation]], [[Java Packages]], [[Java Inheritance]]
- **참조 맥락:** 접근 제어자의 기초 — 캡슐화/패키지/상속 챕터로 확장.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Modifiers — https://www.w3schools.com/java/java_modifiers.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Modifiers" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,67 @@
---
id: java-multiple-variables
title: "Java Multiple Variables"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["Declare Multiple Variables", "자바 다중 변수 선언"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "variables"]
raw_sources: ["https://www.w3schools.com/java/java_variables_multiple.asp"]
applied_in: []
github_commit: ""
---
# [[Java Multiple Variables]]
## 🎯 한 줄 통찰 (One-line insight)
Java supports both comma-separated declaration of same-type variables (`int x = 5, y = 6, z = 50;`) and chained assignment of one value to several variables (`x = y = z = 50;`), each shortening common initialization patterns. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Comma-separated declaration** — `int x = 5, y = 6, z = 50;` declares three same-type variables in one statement. [S1]
- **Trade-off** — shorter to write, but one-per-line can be more readable. [S1]
- **Chained assignment** — `x = y = z = 50;` assigns the same value to multiple variables at once. [S1]
## 📖 세부 내용 (Details)
- Comma-separated: `int x = 5, y = 6, z = 50; System.out.println(x + y + z); // 61`. [S1]
- Chained assignment: `int x, y, z; x = y = z = 50; System.out.println(x + y + z); // 150`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — Python Assign Multiple Values 챕터와 유사한 목적이지만 문법이 다르다(타입 반복 명시 필요). [S1]
## 💻 코드 패턴 (Code patterns)
Comma-separated declaration and chained assignment (Java):
```java
int x = 5, y = 6, z = 50;
int a, b, c;
a = b = c = 50;
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Variables]], [[Python Assign Multiple Values]]
- **참조 맥락:** 여러 변수를 한 줄로 초기화하는 두 가지 방법.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Declare Multiple Variables — https://www.w3schools.com/java/java_variables_multiple.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Declare Multiple Variables" page (Astra wiki-curation, P-Reinforce v3.1 format).
+76
View File
@@ -0,0 +1,76 @@
---
id: java-nested-if
title: "Java Nested If"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 중첩 조건문"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "conditions", "nested-if"]
raw_sources: ["https://www.w3schools.com/java/java_conditions_nested.asp"]
applied_in: []
github_commit: ""
---
# [[Java Nested If]]
## 🎯 한 줄 통찰 (One-line insight)
A nested if only evaluates its inner condition once the outer condition is already true — this makes it functionally different from `&&` combined into one condition, since it lets each level print/branch independently (e.g., "old enough to vote" prints regardless of citizenship, but the vote permission itself depends on both). [S1]
## 🧠 핵심 개념 (Core concepts)
- **Nested if** — placing an if statement inside another if. [S1]
- **Purpose** — check a second condition only when the first is already true. [S1]
- **Depth caution** — the source explicitly warns against nesting too deep, as it can hurt readability. [S1]
- **Combines with else/else if** — nested if is often paired with else at each level for full decision trees. [S1]
## 📖 세부 내용 (Details)
- Basic nesting: `int x = 15; int y = 25; if (x > 10) { System.out.println("x is greater than 10"); if (y > 20) { System.out.println("y is also greater than 20"); } }`. [S1]
- Voting + citizenship real-life example: `int age = 20; boolean isCitizen = true; if (age >= 18) { System.out.println("Old enough to vote."); if (isCitizen) { System.out.println("And you are a citizen, so you can vote!"); } else { System.out.println("But you must be a citizen to vote."); } } else { System.out.println("Not old enough to vote."); }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 서로 의존적인 여러 조건(나이+시민권 등)을 검사할 때 표준적으로 쓰인다. [S1]
## 💻 코드 패턴 (Code patterns)
Nested if with independent inner else (Java):
```java
int age = 20;
boolean isCitizen = true;
if (age >= 18) {
System.out.println("Old enough to vote.");
if (isCitizen) {
System.out.println("And you are a citizen, so you can vote!");
} else {
System.out.println("But you must be a citizen to vote.");
}
} else {
System.out.println("Not old enough to vote.");
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java If Else]], [[Java Conditions Logical Operators]], [[Java Conditions Real Life]]
- **참조 맥락:** 서로 의존적인 다중 조건 판단 — 논리 연산자(&&)와 함께 자주 결합됨.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Nested If — https://www.w3schools.com/java/java_conditions_nested.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Nested If" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,75 @@
---
id: java-non-access-modifiers
title: "Java Non Access Modifiers"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["non-access modifiers", "자바 비접근 제어자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "modifiers", "static", "abstract", "final"]
raw_sources: ["https://www.w3schools.com/java/java_non_modifiers.asp"]
applied_in: []
github_commit: ""
---
# [[Java Non Access Modifiers]]
## 🎯 한 줄 통찰 (One-line insight)
`static` methods "cannot use variables or methods that belong to an object" — this is the key limitation that separates them from instance methods, and it directly explains why `main()` (always static) needs an object to call any instance method inside it. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Non-access modifiers** — don't control visibility, but add other features; most common: `final`, `static`, `abstract`. [S1]
- **`final`** — prevents attribute values from being overridden. [S1]
- **`static`** — belongs to the class itself; callable without creating an object; shared across all instances; CANNOT access object-specific (instance) members. [S1]
- **`abstract`** — an abstract method has no body; the body is provided by a subclass; only valid inside an abstract class. [S1]
- **Class-level list** — for classes: `final` (cannot be inherited) or `abstract` (cannot instantiate directly). [S1]
- **Member-level list** — `final`, `static`, `abstract`, `transient` (skipped during serialization), `synchronized` (one-thread-at-a-time access), `volatile` (always read from main memory, no thread-local caching). [S1]
## 📖 세부 내용 (Details)
- Final attributes: `final int x = 10; final double PI = 3.14; ... myObj.x = 50; // Error`. [S1]
- Static method call without object: `static void myStaticMethod() {...} ... myStaticMethod(); Main.myStaticMethod();`. [S1]
- Abstract class/method: `abstract class Main { public abstract void study(); } class Student extends Main { public void study() { System.out.println("Studying all day long"); } }`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **static의 제약**: 클래스 자체에 속하므로 객체 없이 호출 가능하지만, 객체에 속한 변수/메서드는 사용할 수 없다는 점이 명시됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — abstract 클래스/메서드는 상속(Inheritance)/추상화(Abstraction) 챕터에서 본격적으로 다뤄지는 개념의 예고편이다. [S1]
## 💻 코드 패턴 (Code patterns)
Abstract class with subclass providing the method body (Java):
```java
abstract class Main {
public abstract void study(); // no body
}
class Student extends Main {
public void study() {
System.out.println("Studying all day long");
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Modifiers]], [[Java Inheritance]], [[Java Abstraction]], [[Java Constants Final]]
- **참조 맥락:** static/abstract/final의 기초 — 상속/추상화 챕터에서 심화.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Non-Access Modifiers — https://www.w3schools.com/java/java_non_modifiers.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Non-Access Modifiers" page (Astra wiki-curation, P-Reinforce v3.1 format).
+75
View File
@@ -0,0 +1,75 @@
---
id: java-numbers
title: "Java Numbers"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["byte short int long float double", "자바 숫자 타입"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "numbers", "int", "double"]
raw_sources: ["https://www.w3schools.com/java/java_data_types_numbers.asp"]
applied_in: []
github_commit: ""
---
# [[Java Numbers]]
## 🎯 한 줄 통찰 (One-line insight)
`long` values need a trailing `L` and `float` values need a trailing `f` (double needs `d`, but it's optional since double is the default) — omitting these suffixes on large/decimal literals causes compile errors or silent precision loss. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Integer types** — `byte`, `short`, `int` (preferred default for whole numbers), `long` (for values too large for int, requires `L` suffix). [S1]
- **Floating point types** — `float` (requires `f` suffix, 6-7 decimal digit precision), `double` (15-16 digit precision, preferred for most calculations). [S1]
- **Scientific notation** — `float f1 = 35e3f; double d1 = 12E4d;` uses `e`/`E` for powers of 10. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Literal suffix requirement scales with type size** — `L` for long, `f` for float, `d` for double (optional) — the suffix tells the compiler which literal type to use, since Java's default numeric literal types are `int` and `double`. [S1]
- **double as the safe default for decimals** — the tutorial explicitly recommends double over float for most calculations due to its much higher precision. [S1]
## 📖 세부 내용 (Details)
- byte: `byte myNum = 100;` (range -128 to 127). [S1]
- short: `short myNum = 5000;` (range -32768 to 32767). [S1]
- int: `int myNum = 100000;` (preferred default). [S1]
- long: `long myNum = 15000000000L;` (note the `L` suffix). [S1]
- float: `float myNum = 5.75f;`. [S1]
- double: `double myNum = 19.99d;`. [S1]
- Scientific notation: `float f1 = 35e3f; double d1 = 12E4d;`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — Type Casting 챕터에서 이 숫자 타입들 간 자동/수동 변환이 다뤄진다. [S1]
## 💻 코드 패턴 (Code patterns)
Long and float literal suffixes (Java):
```java
long myNum = 15000000000L;
float myFloat = 5.75f;
double myDouble = 19.99d; // d is optional (double is the default)
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Data Types]], [[Java Type Casting]], [[Java Math]]
- **참조 맥락:** 6개 숫자 타입의 상세 — 리터럴 접미사(L/f/d) 규칙이 핵심.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Numbers — https://www.w3schools.com/java/java_data_types_numbers.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Numbers" page (Astra wiki-curation, P-Reinforce v3.1 format).
+62
View File
@@ -0,0 +1,62 @@
---
id: java-oop
title: "Java OOP"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["object-oriented programming", "자바 OOP"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop"]
raw_sources: ["https://www.w3schools.com/java/java_oop.asp"]
applied_in: []
github_commit: ""
---
# [[Java OOP]]
## 🎯 한 줄 통찰 (One-line insight)
The class/object relationship is framed as template vs. instance from the very first OOP chapter — a class (Fruit) is a blueprint, while objects (Apple, Banana, Mango) are concrete instances that each inherit the class's variables and methods, setting up every subsequent OOP chapter. [S1]
## 🧠 핵심 개념 (Core concepts)
- **OOP** — Object-Oriented Programming: creating objects that bundle data AND methods together, vs. procedural programming's separate data/procedures. [S1]
- **DRY principle** — "Don't Repeat Yourself" — extract common code to a single place and reuse it. [S1]
- **Class** — a template/blueprint for objects. [S1]
- **Object** — an instance of a class; inherits all variables and methods from its class. [S1]
- **OOP advantages** — faster/easier execution, clear structure, DRY-friendly maintainability, reusable applications with less code. [S1]
## 📖 세부 내용 (Details)
- Fruit → Apple/Banana/Mango, Car → Volvo/Audi/Toyota illustrate class-vs-objects. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — OOP 전체 섹션(클래스/객체/생성자/상속/다형성 등)의 개념적 출발점이다. [S1]
## 💻 코드 패턴 (Code patterns)
해당 챕터는 개념 소개 중심으로 별도 코드 예제가 없음 — 다음 챕터([[Java Classes]])에서 실제 클래스 선언 문법이 시작된다.
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Classes]], [[Java Class Attributes]], [[Java Class Methods]]
- **참조 맥락:** OOP 섹션 전체의 개념적 도입부 — 클래스/객체 문법으로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java OOP — https://www.w3schools.com/java/java_oop.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java - What is OOP?" page (Astra wiki-curation, P-Reinforce v3.1 format).
+60
View File
@@ -0,0 +1,60 @@
---
id: java-operators
title: "Java Operators"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 연산자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "operators"]
raw_sources: ["https://www.w3schools.com/java/java_operators.asp"]
applied_in: []
github_commit: ""
---
# [[Java Operators]]
## 🎯 한 줄 통찰 (One-line insight)
Java groups operators into five families — arithmetic, assignment, comparison, logical, bitwise — mirroring Python's grouping almost exactly, minus Python's separate identity/membership operator categories. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Operators** — perform operations on variables and values. [S1]
- **Five operator groups** — Arithmetic, Assignment, Comparison, Logical, Bitwise. [S1]
## 📖 세부 내용 (Details)
- Basic addition: `int x = 100 + 50;`. [S1]
- Chained variable arithmetic: `int sum1 = 100 + 50; int sum2 = sum1 + 250; int sum3 = sum2 + sum2;`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 이 개론 뒤에 5개 연산자 그룹 각각의 전용 챕터가 이어진다. [S1]
## 💻 코드 패턴 (Code patterns)
소스에 코드 예시 없음 (개론 페이지, 각 연산자 그룹 챕터에서 코드 제공).
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Operators Arithmetic]], [[Java Operators Comparison]], [[Java Operators Logical]]
- **참조 맥락:** 5개 연산자 그룹 챕터의 상위 개론 문서.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Operators — https://www.w3schools.com/java/java_operators.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Operators" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,75 @@
---
id: java-operators-arithmetic
title: "Java Operators Arithmetic"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["increment decrement", "자바 산술 연산자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "operators", "arithmetic", "increment"]
raw_sources: ["https://www.w3schools.com/java/java_operators_arithmetic.asp"]
applied_in: []
github_commit: ""
---
# [[Java Operators Arithmetic]]
## 🎯 한 줄 통찰 (One-line insight)
Dividing two `int` values ALWAYS truncates to an integer result (`10 / 3` gives `3`, not `3.33`) — getting a decimal result requires both operands to be `double`, making this a common source of silent precision loss for beginners. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Arithmetic operators** — `+`, `-`, `*`, `/`, `%` (modulus), `++` (increment), `--` (decrement). [S1]
- **Integer division truncates** — `int / int` always yields an `int`, discarding any remainder. [S1]
- **Double division preserves decimals** — `double / double` yields the actual fractional result. [S1]
- **`++`/`--`** — increase/decrease a variable by exactly 1. [S1]
- **Increment then decrement cancels out** — ending value equals the starting value. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Integer division truncation is the classic footgun** — `10 / 3` silently gives `3` in Java (as in most statically-typed languages), unlike Python 3 where `/` always returns a float; this difference trips up developers moving between languages. [S1]
- **Counter pattern via ++/--** — tracking a running count (e.g. people entering/leaving a room) is the canonical real-world use of increment/decrement. [S1]
## 📖 세부 내용 (Details)
- All operators demoed: `int x = 10; int y = 3; println(x + y); println(x - y); println(x * y); println(x / y); println(x % y);`. [S1]
- Integer vs. double division: `int a = 10; int b = 3; System.out.println(a / b); // 3 (truncated)` vs. `double c = 10.0d; double d = 3.0d; System.out.println(c / d); // 3.333...`. [S1]
- Increment/decrement counter: `int peopleInRoom = 0; peopleInRoom++; peopleInRoom++; peopleInRoom--;`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **정수 나눗셈의 절삭 동작**: `int / int`는 항상 정수 결과를 반환하며 소수점 이하는 버려진다는 점이 명시적으로 경고됨 — Type Casting 챕터의 double 캐스팅 해법과 연결된다. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 사람 수 카운팅 같은 실전 예제에서 증감 연산자의 용도가 직접 등장한다. [S1]
## 💻 코드 패턴 (Code patterns)
Integer division truncates, double division doesn't (Java):
```java
int a = 10, b = 3;
System.out.println(a / b); // 3 (truncated)
double c = 10.0d, d = 3.0d;
System.out.println(c / d); // 3.333...
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Operators]], [[Java Type Casting]], [[Java Numbers]]
- **참조 맥락:** 정수 나눗셈 절삭 문제는 Type Casting 챕터의 double 캐스팅 해법과 직접 연결된다.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Arithmetic Operators — https://www.w3schools.com/java/java_operators_arithmetic.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Arithmetic Operators" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,66 @@
---
id: java-operators-assign
title: "Java Operators Assign"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["Assignment Operators", "자바 대입 연산자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "operators", "assignment"]
raw_sources: ["https://www.w3schools.com/java/java_operators_assign.asp"]
applied_in: []
github_commit: ""
---
# [[Java Operators Assign]]
## 🎯 한 줄 통찰 (One-line insight)
Every compound assignment operator (`+=`, `-=`, `&=`, `>>=`, etc.) is pure shorthand for `x = x <op> value` — Java has 11 of them, covering arithmetic, bitwise, and shift operations, all following the identical expansion rule. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`=`** — basic assignment. [S1]
- **Compound assignment operators** — `+=`, `-=`, `*=`, `/=`, `%=`, `&=`, `|=`, `^=`, `>>=`, `<<=`, each a shorthand for `x = x <op> value`. [S1]
## 📖 세부 내용 (Details)
- Basic: `int x = 10;`. [S1]
- Compound: `x += 5;` (same as `x = x + 5;`). [S1]
- Real-life savings tracker: `int savings = 100; savings += 50; System.out.println("Total savings: " + savings);`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 저축액 누적 추적처럼 값을 점진적으로 증가/감소시키는 패턴에 표준적으로 쓰인다. [S1]
## 💻 코드 패턴 (Code patterns)
Compound assignment for accumulation (Java):
```java
int savings = 100;
savings += 50; // same as: savings = savings + 50
System.out.println("Total savings: " + savings);
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Operators]], [[Java Operators Arithmetic]]
- **참조 맥락:** 값 할당 축약 문법 — 누적 계산에 표준적으로 사용.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Assignment Operators — https://www.w3schools.com/java/java_operators_assign.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Assignment Operators" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,68 @@
---
id: java-operators-comparison
title: "Java Operators Comparison"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 비교 연산자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "operators", "comparison"]
raw_sources: ["https://www.w3schools.com/java/java_operators_comparison.asp"]
applied_in: []
github_commit: ""
---
# [[Java Operators Comparison]]
## 🎯 한 줄 통찰 (One-line insight)
Comparison operators always resolve to a boolean, which is exactly what If...Else and loop conditions consume — comparisons are the bridge between raw values and program control flow. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Comparison operators** — `==`, `!=`, `>`, `<`, `>=`, `<=`; return true or false. [S1]
- **Purpose** — help programs find answers and make decisions. [S1]
## 📖 세부 내용 (Details)
- Basic comparison: `int x = 5; int y = 3; System.out.println(x > y); // true`. [S1]
- Voting age check: `int age = 18; System.out.println(age >= 18); // true`. [S1]
- Password length check: `int passwordLength = 5; System.out.println(passwordLength >= 8); // false`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 투표 연령/비밀번호 길이 검증처럼 실전 조건 검사의 기초 도구다. [S1]
## 💻 코드 패턴 (Code patterns)
Real-world condition checks (Java):
```java
int age = 18;
System.out.println(age >= 18); // true, old enough to vote
int passwordLength = 5;
System.out.println(passwordLength >= 8); // false, too short
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Booleans Type]], [[Java If Else]], [[Java Operators Logical]]
- **참조 맥락:** 조건문/반복문의 조건식을 구성하는 기초 연산자.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Comparison Operators — https://www.w3schools.com/java/java_operators_comparison.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Comparison Operators" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,69 @@
---
id: java-operators-logical
title: "Java Operators Logical"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["&& || !", "자바 논리 연산자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "operators", "logical"]
raw_sources: ["https://www.w3schools.com/java/java_operators_logical.asp"]
applied_in: []
github_commit: ""
---
# [[Java Operators Logical]]
## 🎯 한 줄 통찰 (One-line insight)
Java's logical operators use symbolic form (`&&`, `||`, `!`) rather than Python's keyword form (`and`, `or`, `not`) — same semantics, different syntax, a common point of confusion when switching between the two languages. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`&&` (logical AND)** — true if BOTH statements are true. [S1]
- **`||` (logical OR)** — true if AT LEAST ONE statement is true. [S1]
- **`!` (logical NOT)** — reverses the result. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Access-control logic via boolean combination** — `isLoggedIn && !isAdmin` ("regular user"), `isLoggedIn || isAdmin` ("has access") shows how login/permission checks compose from simple booleans using logical operators. [S1]
## 📖 세부 내용 (Details)
- Login/access check: `boolean isLoggedIn = true; boolean isAdmin = false; System.out.println("Regular user: " + (isLoggedIn && !isAdmin)); System.out.println("Has access: " + (isLoggedIn || isAdmin));`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **Python과 문법 차이**: Python은 `and`/`or`/`not` 키워드를 쓰지만 Java는 `&&`/`||`/`!` 기호를 쓴다. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 로그인 상태/권한 확인처럼 여러 불리언을 조합하는 실전 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Login/permission check via logical operators (Java):
```java
boolean isLoggedIn = true;
boolean isAdmin = false;
System.out.println("Regular user: " + (isLoggedIn && !isAdmin));
System.out.println("Has access: " + (isLoggedIn || isAdmin));
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Operators Comparison]], [[Java If Else]], [[Python Operators Logical]]
- **참조 맥락:** Python의 and/or/not과 동일한 개념이지만 기호(&&/||/!)로 표기.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Logical Operators — https://www.w3schools.com/java/java_operators_logical.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Logical Operators" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,65 @@
---
id: java-operators-precedence
title: "Java Operators Precedence"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["order of operations", "자바 연산자 우선순위"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "operators", "precedence"]
raw_sources: ["https://www.w3schools.com/java/java_operators_precedence.asp"]
applied_in: []
github_commit: ""
---
# [[Java Operators Precedence]]
## 🎯 한 줄 통찰 (One-line insight)
Java's precedence order runs parentheses → multiplicative → additive → comparison → equality → logical AND → logical OR → assignment, and left-to-right evaluation applies when operators share the same precedence tier. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Precedence order (high → low)** — `()``*`/`/`/`%``+`/`-` → comparisons (`>`,`<`,`>=`,`<=`) → equality (`==`,`!=`) → `&&``||``=`. [S1]
- **Parentheses always win** — used to force a specific evaluation order. [S1]
- **Left-to-right for equal precedence** — e.g. subtraction and addition evaluate left to right without parentheses. [S1]
## 📖 세부 내용 (Details)
- Multiplication before addition: `int result1 = 2 + 3 * 4; // 14` vs. `int result2 = (2 + 3) * 4; // 20`. [S1]
- Left-to-right on equal precedence: `int result1 = 10 - 2 + 5; // (10-2)+5 = 13` vs. `int result2 = 10 - (2 + 5); // 10-7 = 3`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 복합 표현식의 평가 순서를 예측해야 할 때 항상 참조하는 표다. [S1]
## 💻 코드 패턴 (Code patterns)
Parentheses override default precedence (Java):
```java
int result1 = 2 + 3 * 4; // 14 (multiplication first)
int result2 = (2 + 3) * 4; // 20 (parentheses force addition first)
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Operators Arithmetic]], [[Java Operators Logical]]
- **참조 맥락:** 모든 연산자를 종합한 우선순위 표 — 복합 표현식 평가 순서 확인용.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Operator Precedence — https://www.w3schools.com/java/java_operators_precedence.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Operator Precedence" page (Astra wiki-curation, P-Reinforce v3.1 format).
+65
View File
@@ -0,0 +1,65 @@
---
id: java-output
title: "Java Output"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["println()", "print()", "자바 출력"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "output", "println"]
raw_sources: ["https://www.w3schools.com/java/java_output.asp"]
applied_in: []
github_commit: ""
---
# [[Java Output]]
## 🎯 한 줄 통찰 (One-line insight)
`println()` and `print()` differ only in whether a newline follows — but the tutorial deliberately sticks to `println()` throughout for readability, treating `print()` as a rarely-needed variant. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`println()`** — prints text/values, adding a newline after each call. [S1]
- **Double quotes required** — text must be wrapped in `""`; omitting them is a compile error. [S1]
- **`print()`** — same as `println()` but does NOT add a trailing newline. [S1]
## 📖 세부 내용 (Details)
- Multiple println calls: `System.out.println("Hello World!"); System.out.println("I am learning Java.");` — each on its own line. [S1]
- print() without newline: `System.out.print("Hello World! "); System.out.print("I will print on the same line.");`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 이 튜토리얼 전체에서 println()만 일관되게 사용한다고 명시됨. [S1]
## 💻 코드 패턴 (Code patterns)
print() without a trailing newline (Java):
```java
System.out.print("Hello World! ");
System.out.print("I will print on the same line.");
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Print Numbers]], [[Java Strings]]
- **참조 맥락:** 텍스트 출력의 기본 — 숫자 출력은 다음 챕터로 이어진다.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Output / Print — https://www.w3schools.com/java/java_output.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Output / Print" page (Astra wiki-curation, P-Reinforce v3.1 format).
+77
View File
@@ -0,0 +1,77 @@
---
id: java-packages
title: "Java Packages"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["import keyword", "자바 패키지"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "packages", "import"]
raw_sources: ["https://www.w3schools.com/java/java_packages.asp"]
applied_in: []
github_commit: ""
---
# [[Java Packages]]
## 🎯 한 줄 통찰 (One-line insight)
Building your own package requires a two-step compile that most beginners miss — first `javac MyPackageClass.java`, then `javac -d . MyPackageClass.java` (the `-d` flag actually creates the package's folder structure); skipping the second step means the package folder never materializes. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Package** — groups related classes, like a folder; avoids name conflicts, improves maintainability. [S1]
- **Built-in packages** — the Java API, a library of prewritten classes (e.g. `java.util`). [S1]
- **User-defined packages** — created via the `package` keyword, mapped to actual filesystem directories. [S1]
- **`import`** — `import package.name.Class;` for a single class, `import package.name.*;` for the whole package. [S1]
- **`-d` compiler flag** — specifies the destination folder, forcing the compiler to create the package directory structure. [S1]
- **Lowercase package naming convention** — avoids conflicts with class names (which start uppercase). [S1]
## 📖 세부 내용 (Details)
- Import a single class: `import java.util.Scanner; ... Scanner myObj = new Scanner(System.in); String userName = myObj.nextLine();`. [S1]
- Import whole package: `import java.util.*;`. [S1]
- User-defined package: `package mypack; class MyPackageClass { public static void main(String[] args) { System.out.println("This is my package!"); } }`. [S1]
- Compile + run: `javac MyPackageClass.java` then `javac -d . MyPackageClass.java`, then run via `java mypack.MyPackageClass`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — Scanner 클래스를 이용한 사용자 입력 처리가 java.util 패키지 활용의 대표 실전 사례다. [S1]
## 💻 코드 패턴 (Code patterns)
Using Scanner from java.util for user input (Java):
```java
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner myObj = new Scanner(System.in);
System.out.println("Enter username");
String userName = myObj.nextLine();
System.out.println("Username is: " + userName);
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Encapsulation]], [[Java Inheritance]], [[Java User Input]]
- **참조 맥락:** 클래스 그룹화 및 import 문법 — 사용자 입력(Scanner)/상속 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Packages & API — https://www.w3schools.com/java/java_packages.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Packages & API" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,70 @@
---
id: java-polymorphism
title: "Java Polymorphism"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 다형성"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "oop", "polymorphism"]
raw_sources: ["https://www.w3schools.com/java/java_polymorphism.asp"]
applied_in: []
github_commit: ""
---
# [[Java Polymorphism]]
## 🎯 한 줄 통찰 (One-line insight)
Declaring `Animal myPig = new Pig();` — parent type on the left, subclass instance on the right — is the exact mechanism that lets `myPig.animalSound()` call Pig's overridden version, not Animal's default: polymorphism means the SAME method call resolves differently depending on the actual object type, not the declared variable type. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Polymorphism** — "many forms"; occurs when related classes (via inheritance) implement the same method differently. [S1]
- **Method overriding across subclasses** — each subclass (Pig, Dog) provides its own `animalSound()` implementation. [S1]
- **Same action, different behavior** — calling `animalSound()` on different object types produces different output through one shared method name. [S1]
- **Parent-typed reference to subclass instance** — `Animal myPig = new Pig();` is valid and dispatches to Pig's override. [S1]
## 📖 세부 내용 (Details)
- Overridden methods: `class Animal { public void animalSound() { System.out.println("The animal makes a sound"); } } class Pig extends Animal { public void animalSound() { System.out.println("The pig says: wee wee"); } } class Dog extends Animal { public void animalSound() { System.out.println("The dog says: bow wow"); } }`. [S1]
- Polymorphic dispatch: `Animal myAnimal = new Animal(); Animal myPig = new Pig(); Animal myDog = new Dog(); myAnimal.animalSound(); myPig.animalSound(); myDog.animalSound();` — each call produces the subclass-specific sound. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — Animal/Pig/Dog 계층은 다형성 개념의 표준 교육용 예제다. [S1]
## 💻 코드 패턴 (Code patterns)
Polymorphic method dispatch via parent-typed references (Java):
```java
Animal myAnimal = new Animal();
Animal myPig = new Pig();
Animal myDog = new Dog();
myAnimal.animalSound(); // The animal makes a sound
myPig.animalSound(); // The pig says: wee wee
myDog.animalSound(); // The dog says: bow wow
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Inheritance]], [[Java Super Keyword]], [[Java Abstraction]], [[Java Interface]]
- **참조 맥락:** 상속 기반 메서드 오버라이딩의 활용 — super 키워드 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Polymorphism — https://www.w3schools.com/java/java_polymorphism.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Polymorphism" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,63 @@
---
id: java-print-numbers
title: "Java Print Numbers"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 숫자 출력"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "output", "numbers"]
raw_sources: ["https://www.w3schools.com/java/java_output_numbers.asp"]
applied_in: []
github_commit: ""
---
# [[Java Print Numbers]]
## 🎯 한 줄 통찰 (One-line insight)
Numbers passed to println() are never quoted, and arithmetic expressions can be evaluated directly inside the call — the same convention as Python's print(). [S1]
## 🧠 핵심 개념 (Core concepts)
- **Numbers unquoted** — `System.out.println(3);` not `println("3")`. [S1]
- **Inline math** — `System.out.println(3 + 3);` evaluates before printing. [S1]
## 📖 세부 내용 (Details)
- Plain numbers: `System.out.println(3); System.out.println(358);`. [S1]
- Arithmetic: `System.out.println(3 + 3); System.out.println(2 * 5);`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — Java Operators Arithmetic 챕터에서 이 연산이 전체 연산자 집합으로 확장된다. [S1]
## 💻 코드 패턴 (Code patterns)
Inline math in println (Java):
```java
System.out.println(3 + 3); // 6
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Output]], [[Java Operators Arithmetic]]
- **참조 맥락:** 숫자 출력의 기초 — Operators Arithmetic 챕터로 확장.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Output Numbers — https://www.w3schools.com/java/java_output_numbers.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Output Numbers" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,74 @@
---
id: java-print-variables
title: "Java Print Variables"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 변수 출력"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "variables", "concatenation"]
raw_sources: ["https://www.w3schools.com/python/python_variables_output.asp", "https://www.w3schools.com/java/java_variables_print.asp"]
applied_in: []
github_commit: ""
---
# [[Java Print Variables]]
## 🎯 한 줄 통찰 (One-line insight)
The `+` operator is dangerously overloaded — without parentheses, `"The sum is " + x + y` concatenates left-to-right as strings (`"56"`), while `"The sum is " + (x + y)` forces numeric addition first (`11`) — the exact same expression differing only in parenthesization. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`+` for display** — combines text and a variable: `"Hello " + name`. [S1]
- **`+` on two variables** — concatenates or adds depending on type. [S1]
- **`+` dual meaning** — string concatenation for text, arithmetic addition for numbers. [S1]
- **Left-to-right evaluation without parentheses** — mixing string and numeric `+` operands evaluates strictly left to right, so once a string appears, everything after becomes string concatenation. [S1]
- **Parentheses force numeric evaluation first** — `(x + y)` computes the sum before concatenating with the string. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **The `"sum is " + x + y` footgun** — this is a well-known Java gotcha: without parentheses around `x + y`, the output silently becomes string concatenation ("56") instead of the intended numeric sum ("11"), with no compiler warning. [S1]
## 📖 세부 내용 (Details)
- Text + variable: `String name = "John"; System.out.println("Hello " + name);`. [S1]
- Variable + variable (string concat): `String fullName = firstName + lastName;`. [S1]
- Numeric addition: `int x = 5; int y = 6; System.out.println(x + y); // 11`. [S1]
- Mixing footgun: `System.out.println("The sum is " + x + y); // "The sum is 56"` vs. `System.out.println("The sum is " + (x + y)); // "The sum is 11"`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음. 괄호 유무로 인한 결과 차이가 소스에서 직접 경고됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 텍스트와 숫자를 함께 출력할 때 항상 괄호로 연산 순서를 명시하는 습관이 필요하다. [S1]
## 💻 코드 패턴 (Code patterns)
The parenthesization footgun (Java):
```java
int x = 5;
int y = 6;
System.out.println("The sum is " + x + y); // "The sum is 56"
System.out.println("The sum is " + (x + y)); // "The sum is 11"
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Variables]], [[Java Strings Concat]], [[Java Strings Numbers]]
- **참조 맥락:** + 연산자의 이중 의미(연결/덧셈)를 다루는 핵심 문서 — 괄호로 순서를 명시하는 습관이 중요하다.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Print Variables — https://www.w3schools.com/java/java_variables_print.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Print Variables" page (Astra wiki-curation, P-Reinforce v3.1 format).
+72
View File
@@ -0,0 +1,72 @@
---
id: java-projects
title: "Java Projects"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 실습 프로젝트"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "projects"]
raw_sources: ["https://www.w3schools.com/java/java_projects.asp"]
applied_in: []
github_commit: ""
---
# [[Java Projects]]
## 🎯 한 줄 통찰 (One-line insight)
The student-average project deliberately validates input BEFORE processing (`if (count < 1 || count > 5) { ...; return; }`), demonstrating that a real small project isn't just "loop + math" — it's the combination of Scanner input, validation/early-return, a loop-based accumulator, and a helper method (`gradeFunction`) that turns tutorial-sized concepts into a working mini-application. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Why build projects** — understand real program structure, practice combining concepts, improve debugging skills, prepare for interviews. [S1]
- **Progression** — start with simple I/O (name/age greeting), then loop+condition+array projects (shopping list, guessing game, student average), then class/file-based projects (calculator, address book, to-do list, quiz game). [S1]
- **Featured project: Student Average** — combines Scanner input, input validation with early return, an accumulator loop, and a helper method mapping a numeric average to a letter grade. [S1]
## 📖 세부 내용 (Details)
- Input validation with early return: `if (count < 1 || count > 5) { System.out.println("Invalid number. You must enter between 1 and 5 grades."); scanner.close(); return; }`. [S1]
- Accumulator loop: `double sum = 0.0; for (int i = 1; i <= count; i++) { double grade = scanner.nextDouble(); sum += grade; } double avg = sum / count;`. [S1]
- Helper method mapping average to letter grade: `static char gradeFunction(double avg) { if (avg >= 90) return 'A'; else if (avg >= 80) return 'B'; else if (avg >= 70) return 'C'; else if (avg >= 60) return 'D'; else return 'F'; }`. [S1]
- Practice challenge: shopping list using an array, with an extra challenge to add item search. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
학생 평균 성적 계산 프로그램이 Scanner 입력, 유효성 검증, 누적 반복, 헬퍼 메서드를 결합한 실전 미니 애플리케이션의 대표 사례다. [S1]
## 💻 코드 패턴 (Code patterns)
Average-to-letter-grade helper method (Java):
```java
static char gradeFunction(double avg) {
if (avg >= 90) return 'A';
else if (avg >= 80) return 'B';
else if (avg >= 70) return 'C';
else if (avg >= 60) return 'D';
else return 'F';
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java User Input]], [[Java Methods Return]], [[Java Arrays]], [[Java Advanced Sorting]]
- **참조 맥락:** Java 튜토리얼 전체의 최종 종합 실습 챕터 — Scanner/메서드/배열/조건문 등 전 과정을 통합.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Projects — https://www.w3schools.com/java/java_projects.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Projects" page (Astra wiki-curation, P-Reinforce v3.1 format).
+76
View File
@@ -0,0 +1,76 @@
---
id: java-recursion
title: "Java Recursion"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 재귀"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "recursion"]
raw_sources: ["https://www.w3schools.com/java/java_recursion.asp"]
applied_in: []
github_commit: ""
---
# [[Java Recursion]]
## 🎯 한 줄 통찰 (One-line insight)
Every recursive method needs an explicit halting condition — its absence produces infinite recursion, the recursive analog of an infinite loop, making the halting condition (e.g., `k == 0`, `end <= start`, `n <= 1`) the single most load-bearing part of any recursive design. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Recursion** — a function calling itself to break a complex problem into simpler sub-problems. [S1]
- **Halting condition** — the required condition where the method stops calling itself, preventing infinite recursion. [S1]
- **Call stack unwinding** — `sum(10)` expands to `10 + (9 + (8 + ... + sum(0)))`, resolving only once the base case returns. [S1]
- **Recursion vs. infinite loop danger** — like loops, recursion can run forever or exhaust memory if the halting condition is wrong/missing. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Three recursion archetypes shown together** — accumulator recursion (`sum`), side-effecting recursion with no return value (`countdown`, using `void` and print-then-recurse), and multiplicative accumulator recursion (`factorial`) — covering the main shapes recursive functions take. [S1]
## 📖 세부 내용 (Details)
- Sum 1 to 10: `public static int sum(int k) { if (k > 0) { return k + sum(k - 1); } else { return 0; } } ... sum(10); // 55`. [S1]
- Sum with start/end: `public static int sum(int start, int end) { if (end > start) { return end + sum(start, end - 1); } else { return end; } } ... sum(5, 10); // 45`. [S1]
- Countdown (void recursion): `static void countdown(int n) { if (n > 0) { System.out.print(n + " "); countdown(n - 1); } } ... countdown(5); // 5 4 3 2 1`. [S1]
- Factorial: `static int factorial(int n) { if (n > 1) { return n * factorial(n - 1); } else { return 1; } } ... factorial(5); // 120`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **정지 조건의 필수성**: 정지 조건이 없으면 무한 재귀에 빠진다는 점이 소스에서 반복 강조됨(반복문의 무한 루프와 동일한 위험). [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 팩토리얼/카운트다운/범위 합계 계산 등 재귀의 대표적 응용 예제들이다. [S1]
## 💻 코드 패턴 (Code patterns)
Recursive factorial with halting condition (Java):
```java
static int factorial(int n) {
if (n > 1) {
return n * factorial(n - 1);
} else {
return 1;
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Methods Return]], [[Java Scope]], [[Java OOP]]
- **참조 맥락:** 함수가 자기 자신을 호출하는 패턴 — 정지 조건 설계가 핵심. OOP 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Recursion — https://www.w3schools.com/java/java_recursion.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Recursion" page (Astra wiki-curation, P-Reinforce v3.1 format).
+74
View File
@@ -0,0 +1,74 @@
---
id: java-regex
title: "Java RegEx"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["regular expressions", "자바 정규표현식"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "regex"]
raw_sources: ["https://www.w3schools.com/java/java_regex.asp"]
applied_in: []
github_commit: ""
---
# [[Java RegEx]]
## 🎯 한 줄 통찰 (One-line insight)
Java has no built-in Regular Expression type — like dates, regex requires importing `java.util.regex` (Pattern + Matcher classes), and the search flow is explicitly two-step: `Pattern.compile()` builds the pattern object first, then `.matcher(text).find()` runs the actual search against a specific string, decoupling "what to search for" from "where to search." [S1]
## 🧠 핵심 개념 (Core concepts)
- **Regular expression** — a sequence of characters forming a search pattern for text search/replace. [S1]
- **`java.util.regex` package** — required import; contains `Pattern`, `Matcher`, `PatternSyntaxException`. [S1]
- **`Pattern.compile(regex, flags)`** — builds the pattern; flags are optional (e.g. `Pattern.CASE_INSENSITIVE`). [S1]
- **`pattern.matcher(text)`** — returns a `Matcher` bound to a specific string. [S1]
- **`matcher.find()`** — returns true/false depending on whether the pattern matches. [S1]
- **Bracket expressions** — `[abc]` (any of a/b/c), `[^abc]` (none of a/b/c), `[0-9]` (digit range). [S1]
- **Metacharacters** — `|` (alternation), `.` (any char), `^`/`$` (start/end anchors), `\d` (digit), `\s` (whitespace), `\b` (word boundary), `\uxxxx` (Unicode). [S1]
- **Quantifiers** — `n+`, `n*`, `n?`, `n{x}`, `n{x,y}`, `n{x,}`. [S1]
## 📖 세부 내용 (Details)
- Basic case-insensitive search: `Pattern pattern = Pattern.compile("w3schools", Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher("Visit W3Schools!"); boolean matchFound = matcher.find(); // true`. [S1]
- Flags: `Pattern.CASE_INSENSITIVE`, `Pattern.LITERAL` (treats special chars as ordinary), `Pattern.UNICODE_CASE` (extends case-insensitivity beyond English). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 대소문자 구분 없이 특정 단어의 존재 여부를 검사하는 것이 정규표현식의 가장 기본적인 실전 활용이다. [S1]
## 💻 코드 패턴 (Code patterns)
Case-insensitive pattern search (Java):
```java
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Pattern pattern = Pattern.compile("w3schools", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher("Visit W3Schools!");
boolean matchFound = matcher.find(); // true
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Annotations]], [[Java Strings]], [[Java Threads]]
- **참조 맥락:** 텍스트 검색/치환의 표준 도구 — 스레드(Threads) 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Regular Expressions — https://www.w3schools.com/java/java_regex.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Regular Expressions" page (Astra wiki-curation, P-Reinforce v3.1 format).
+73
View File
@@ -0,0 +1,73 @@
---
id: java-scope
title: "Java Scope"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 변수 범위"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "scope"]
raw_sources: ["https://www.w3schools.com/java/java_scope.asp"]
applied_in: []
github_commit: ""
---
# [[Java Scope]]
## 🎯 한 줄 통찰 (One-line insight)
A loop's counter variable dies when the loop ends, which means the same name (`i`, `j`) can be safely reused across separate loops in the same method — scope isn't just a restriction, it's what enables variable-name reuse without conflict. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Scope** — the region where a variable is accessible; Java variables live only inside the region where they're created. [S1]
- **Method scope** — a variable is usable anywhere in the method AFTER its declaration line, not before. [S1]
- **Block scope** — `{ }` delimits a block; a variable declared inside is accessible only within that block, and only after its declaration line. [S1]
- **Loop scope** — a variable declared in a for-loop header exists only inside that loop; it's destroyed once the loop ends. [S1]
- **Name reuse across loops** — since each loop's `i` is destroyed at loop end, separate loops in the same method can reuse the same variable name. [S1]
## 📖 세부 내용 (Details)
- Method scope: `int x = 100;` declared mid-method is unusable before its declaration line, usable after. [S1]
- Block scope: a variable declared inside `{ }` is inaccessible both before the block and after it ends. [S1]
- Loop scope: `for (int i = 0; i < 5; i++) { System.out.println(i); } // i is NOT accessible here`. [S1]
- Reused loop variable names: two separate `for (int i = 0; ...)` loops in the same method, each with their own independent `i`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 여러 반복문에서 동일한 변수명(i, j)을 안전하게 재사용할 수 있는 근거가 스코프 규칙이다. [S1]
## 💻 코드 패턴 (Code patterns)
Safe reuse of loop variable name across separate loops (Java):
```java
for (int i = 0; i < 3; i++) {
System.out.println("Loop 1: " + i);
}
for (int i = 0; i < 2; i++) {
System.out.println("Loop 2: " + i);
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** 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 Methods]], [[Java Recursion]]
- **참조 맥락:** 변수 접근 범위 규칙 — 메서드/블록/반복문 스코프의 차이.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Scope — https://www.w3schools.com/java/java_scope.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Scope" page (Astra wiki-curation, P-Reinforce v3.1 format).
+63
View File
@@ -0,0 +1,63 @@
---
id: java-set
title: "Java Set"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["Set interface", "자바 셋"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "collections-framework", "set"]
raw_sources: ["https://www.w3schools.com/java/java_set.asp"]
applied_in: []
github_commit: ""
---
# [[Java Set]]
## 🎯 한 줄 통찰 (One-line insight)
Order-preservation is NOT a universal Set property — plain `Set`/`HashSet` gives no order guarantee at all, and only its specific subtypes (`TreeSet` for sorted order, `LinkedHashSet` for insertion order) add that guarantee back, meaning "use a Set" alone doesn't tell you what iteration order to expect. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`Set` interface** — stores unique elements; no duplicates allowed. [S1]
- **No guaranteed order by default** — unless using `TreeSet` or `LinkedHashSet`. [S1]
- **Implementing classes** — `HashSet` (fast, unordered), `TreeSet` (sorted), `LinkedHashSet` (insertion order). [S1]
- **Common methods** — `add()` (no-op if already present), `remove()`, `contains()`, `size()`, `clear()`. [S1]
- **Set vs. List** — List allows duplicates + maintains order + index access; Set disallows duplicates + no order guarantee + no index access. [S1]
## 📖 세부 내용 (Details)
- Method table: add() (ignored if duplicate), remove(), contains() (existence check), size(), clear(). [S1]
- Comparison table: List (duplicates OK, ordered, index access) vs. Set (no duplicates, no order guarantee, no index access). [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 중복을 허용하지 않아야 하는 값 집합 저장에 Set이 표준적으로 쓰인다. [S1]
## 💻 코드 패턴 (Code patterns)
해당 챕터는 개념/메서드표 중심으로 별도 실행 코드 예제가 없음 — 다음 챕터([[Java HashSet]])에서 Set 구현체 실습이 시작된다.
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java List]], [[Java HashSet]], [[Java TreeSet]], [[Java LinkedHashSet]]
- **참조 맥락:** Set 인터페이스의 기초 — HashSet/TreeSet/LinkedHashSet 구현체 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Set Interface — https://www.w3schools.com/java/java_set.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Set Interface" page (Astra wiki-curation, P-Reinforce v3.1 format).
+72
View File
@@ -0,0 +1,72 @@
---
id: java-sort-list
title: "Java Sort List"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["Collections.sort()", "자바 리스트 정렬"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "collections-framework", "sorting"]
raw_sources: ["https://www.w3schools.com/java/java_sort_list.asp"]
applied_in: []
github_commit: ""
---
# [[Java Sort List]]
## 🎯 한 줄 통찰 (One-line insight)
Sorting is a `Collections` class method, NOT a method on the list itself — you call `Collections.sort(cars)`, never `cars.sort()`-style syntax the tutorial's own exercise flags as a common wrong guess, reflecting that sorting logic lives in the utility class, not the list implementation. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`Collections.sort(list)`** — sorts alphabetically (Strings) or numerically (numbers) in ascending order. [S1]
- **`Collections.reverseOrder()`** — passed as a second argument to sort in descending order: `Collections.sort(list, Collections.reverseOrder());`. [S1]
- **Works on ArrayList** (and other List implementations) uniformly. [S1]
## 📖 세부 내용 (Details)
- Ascending String sort: `Collections.sort(cars);`. [S1]
- Ascending Integer sort: `Collections.sort(myNumbers);`. [S1]
- Descending String sort: `Collections.sort(cars, Collections.reverseOrder());`. [S1]
- Descending Integer sort: `Collections.sort(myNumbers, Collections.reverseOrder());`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 오름차순/내림차순 정렬 모두 Collections 클래스의 정적 메서드로 통일되어 있다는 점이 실전 활용의 핵심이다. [S1]
## 💻 코드 패턴 (Code patterns)
Descending sort via Collections.reverseOrder() (Java):
```java
import java.util.ArrayList;
import java.util.Collections;
ArrayList<String> cars = new ArrayList<String>();
cars.add("Volvo");
cars.add("BMW");
Collections.sort(cars, Collections.reverseOrder());
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java ArrayList]], [[Java LinkedList]], [[Java Set]]
- **참조 맥락:** ArrayList/LinkedList 정렬 — Set 인터페이스 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — Java List Sorting — https://www.w3schools.com/java/java_sort_list.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Sort a List" page (Astra wiki-curation, P-Reinforce v3.1 format).
+68
View File
@@ -0,0 +1,68 @@
---
id: java-statements
title: "Java Statements"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 문장"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "statements"]
raw_sources: ["https://www.w3schools.com/java/java_statements.asp"]
applied_in: []
github_commit: ""
---
# [[Java Statements]]
## 🎯 한 줄 통찰 (One-line insight)
Unlike Python's optional semicolons, a Java statement MUST end with `;` — omitting it is a hard compile error (`error: ';' expected`), not just a style violation. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Statement** — a programming instruction executed by the computer. [S1]
- **Semicolon required** — every Java statement must end with `;`. [S1]
- **Missing semicolon = compile error** — `error: ';' expected`. [S1]
- **Sequential execution** — multiple statements execute one by one in written order. [S1]
## 📖 세부 내용 (Details)
- Basic statement: `System.out.println("Java is fun!");`. [S1]
- Missing semicolon error: `System.out.println("Java is fun!")``error: ';' expected`. [S1]
- Sequential statements: three `System.out.println(...)` calls execute top to bottom. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — Python과 달리 세미콜론이 선택이 아닌 필수라는 점이 Java 문법 전체의 기초 규칙이다. [S1]
## 💻 코드 패턴 (Code patterns)
Sequential statements requiring semicolons (Java):
```java
System.out.println("Hello World!");
System.out.println("Have a good day!");
System.out.println("Learning Java is fun!");
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Syntax]], [[Java Output]]
- **참조 맥락:** 세미콜론이 필수라는 Java 문장 종료 규칙.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Statements — https://www.w3schools.com/java/java_statements.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Statements" page (Astra wiki-curation, P-Reinforce v3.1 format).
+78
View File
@@ -0,0 +1,78 @@
---
id: java-strings
title: "Java Strings"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["자바 문자열"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "strings"]
raw_sources: ["https://www.w3schools.com/java/java_strings.asp"]
applied_in: []
github_commit: ""
---
# [[Java Strings]]
## 🎯 한 줄 통찰 (One-line insight)
A Java String is an object with methods, not a raw character array — `length()`, `indexOf()`, `charAt()`, `equals()`, and `trim()` are all method calls (`str.method()`), not built-in functions like Python's `len(str)`. [S1]
## 🧠 핵심 개념 (Core concepts)
- **String** — a double-quoted, object-based text container in Java (not a primitive). [S1]
- **`length()`** — returns character count. [S1]
- **`toUpperCase()` / `toLowerCase()`** — case conversion. [S1]
- **`indexOf(text)`** — position of the first occurrence (0-indexed). [S1]
- **`charAt(index)`** — the character at a specific position. [S1]
- **`equals(other)`** — compares string CONTENT, unlike `==` which compares references. [S1]
- **`trim()`** — removes leading/trailing whitespace. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Method-call syntax throughout** — every string operation is `str.method()`, contrasting with Python's mix of methods (`str.upper()`) and built-in functions (`len(str)`). [S1]
- **`equals()` not `==`** — the tutorial specifically teaches `equals()` for string comparison, implying `==` would compare object references rather than content (a classic Java gotcha, though not elaborated here). [S1]
## 📖 세부 내용 (Details)
- Length: `String txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; txt.length()`. [S1]
- Case conversion: `txt.toUpperCase(); txt.toLowerCase();`. [S1]
- Find position: `String txt = "Please locate where 'locate' occurs!"; txt.indexOf("locate"); // 7`. [S1]
- Character access: `String txt = "Hello"; txt.charAt(0); // H`. [S1]
- Content comparison: `txt1.equals(txt2)`. [S1]
- Trim whitespace: `String txt = " Hello World "; txt.trim(); // "Hello World"`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 이후 Concatenation/Numbers and Strings/Special Characters 챕터에서 문자열 조작이 심화된다. [S1]
## 💻 코드 패턴 (Code patterns)
Content comparison with equals() (Java):
```java
String txt1 = "Hello";
String txt2 = "Hello";
System.out.println(txt1.equals(txt2)); // true
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Strings Concat]], [[Java Strings Numbers]], [[Java Characters]]
- **참조 맥락:** 문자열 메서드의 기초 — equals()로 내용 비교(==와 구분)해야 함이 핵심.
## 📚 출처 (Sources)
- [S1] W3Schools — Java Strings — https://www.w3schools.com/java/java_strings.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java Strings" page (Astra wiki-curation, P-Reinforce v3.1 format).
@@ -0,0 +1,69 @@
---
id: java-strings-concat
title: "Java Strings Concat"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["concat() method", "자바 문자열 연결"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["java", "programming", "w3schools", "strings", "concatenation"]
raw_sources: ["https://www.w3schools.com/java/java_strings_concat.asp"]
applied_in: []
github_commit: ""
---
# [[Java Strings Concat]]
## 🎯 한 줄 통찰 (One-line insight)
Java offers both `+` and a chainable `.concat()` method for joining strings — but the tutorial itself notes most developers prefer `+` for its brevity, making `concat()` a rarely-used alternative. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`+` operator** — joins strings: `firstName + " " + lastName`. [S1]
- **Building sentences** — mixing literal text and variables in one concatenated expression. [S1]
- **`.concat()` method** — `firstName.concat(lastName)`; chainable: `a.concat(b).concat(c)`. [S1]
- **Preference** — `+` is more common due to brevity/readability. [S1]
## 📖 세부 내용 (Details)
- Basic concat with `+`: `String firstName = "John"; String lastName = "Doe"; System.out.println(firstName + " " + lastName);`. [S1]
- Sentence building: `System.out.println("My name is " + name + " and I am " + age + " years old.");`. [S1]
- `.concat()` method: `firstName.concat(lastName)`. [S1]
- Chained concat: `String result = a.concat(b).concat(c);`. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 이름/문장 조합처럼 텍스트와 변수를 함께 출력하는 표준 패턴이다. [S1]
## 💻 코드 패턴 (Code patterns)
Sentence built with concatenation (Java):
```java
String name = "John";
int age = 25;
System.out.println("My name is " + name + " and I am " + age + " years old.");
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[Java Tutorial]]
- **관련 개념:** [[Java Strings]], [[Java Strings Numbers]]
- **참조 맥락:** 문자열 결합의 두 가지 방법 — + 연산자가 더 관용적으로 선호된다.
## 📚 출처 (Sources)
- [S1] W3Schools — Java String Concatenation — https://www.w3schools.com/java/java_strings_concat.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java String Concatenation" page (Astra wiki-curation, P-Reinforce v3.1 format).

Some files were not shown because too many files have changed in this diff Show More