1cfd3bbb56
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고, Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
3.6 KiB
3.6 KiB
id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
| id | title | category | status | verification_status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | created_at | updated_at | review_reason | merge_history | tags | raw_sources | applied_in | github_commit | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| java-super-keyword | Java Super Keyword | Programming_Language | draft | conceptual |
|
B | 0.9 | 2026-07-04 | 2026-07-04 |
|
|
Java Super Keyword
🎯 한 줄 통찰 (One-line insight)
super() (calling the parent constructor) must be the FIRST statement in a subclass constructor — the exact same rule as this() for constructor chaining — meaning Java allows only one "delegate first" call per constructor, either to another local constructor or to the parent's, never both, and only at the very start. [S1]
🧠 핵심 개념 (Core concepts)
super— refers to the parent class of a subclass; primarily resolves name collisions between super/subclass methods or attributes. [S1]super.method()— calls the parent's version of an overridden method. [S1]super.attribute— accesses the parent's attribute when the subclass shadows it with a same-named field. [S1]super()— calls the parent class's constructor; must be the first statement in the subclass constructor. [S1]
📖 세부 내용 (Details)
- Calling parent method:
class Dog extends Animal { public void animalSound() { super.animalSound(); System.out.println("The dog says: bow wow"); } }— outputs both the parent's and child's messages. [S1] - Accessing parent attribute:
class Animal { String type = "Animal"; } class Dog extends Animal { String type = "Dog"; public void printType() { System.out.println(super.type); } }— prints "Animal", not "Dog". [S1] - Calling parent constructor:
class Animal { Animal() { System.out.println("Animal is created"); } } class Dog extends Animal { Dog() { super(); System.out.println("Dog is created"); } }— prints both messages in order. [S1]
⚖️ 모순 및 업데이트 (Contradictions & updates)
- super() 호출 위치 제약: 서브클래스 생성자 내 첫 번째 문장이어야 한다는 점이 Java This Keyword의 this() 규칙과 동일하게 강조됨. [S1]
🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — Animal→Dog 계층에서 부모 생성자/메서드/속성에 접근하는 표준 패턴이다. [S1]
💻 코드 패턴 (Code patterns)
Calling the parent constructor first via super() (Java):
class Animal {
Animal() {
System.out.println("Animal is created");
}
}
class Dog extends Animal {
Dog() {
super(); // must be first statement
System.out.println("Dog is created");
}
}
✅ 검증 상태 및 신뢰도
- 상태: draft
- 검증 단계: conceptual
- 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
- 신뢰 점수: 0.90
- 중복 검사 결과: 신규 생성 (New discovery)
🔗 지식 그래프 (Knowledge Graph)
- 상위/루트: Java Tutorial
- 관련 개념: Java Inheritance, Java This Keyword, Java Polymorphism
- 참조 맥락: 부모 클래스 접근 키워드 — this() 규칙과 대칭되는 제약을 가짐.
📚 출처 (Sources)
- [S1] W3Schools — Java super — https://www.w3schools.com/java/java_super.asp
📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "Java super Keyword" page (Astra wiki-curation, P-Reinforce v3.1 format).