docs(10_Wiki): Dev 폴더 누락분 반영 — Topic_Programming으로 통합
이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영. - Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들 (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거. - Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/ Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/ Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이 존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존). - Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/ JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동. - 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리. - Topic_Programming 최종 문서 수: 2784 → 3985.
This commit is contained in:
@@ -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).
|
||||
Reference in New Issue
Block a user