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:
Antigravity Agent
2026-07-05 00:39:13 +09:00
parent 9148c358d0
commit e9cbf23ab5
1356 changed files with 0 additions and 12831 deletions
@@ -0,0 +1,83 @@
---
id: csharp-access-modifiers
title: "C# Access Modifiers"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["public private protected internal C#", "C# 접근 제한자"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.85
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["csharp", "programming-language", "w3schools", "oop", "access-modifiers"]
raw_sources: ["https://www.w3schools.com/cs/cs_access_modifiers.php"]
applied_in: []
github_commit: ""
---
# [[CSharp Access Modifiers]]
## 🎯 한 줄 통찰 (One-line insight)
C# adds a FOURTH access level — `internal` (accessible within the same assembly, not across assemblies) — that has no direct C++ equivalent, since "assembly" is a .NET-specific compiled-unit concept C++'s translation-unit/library model doesn't share; meanwhile `public`/`private`/`protected` carry the same meanings as C++, and the default-to-`private`-when-unspecified rule for class members is IDENTICAL to what Topic_CPP already confirmed for C++ classes — making `internal` (plus the two combinations `protected internal` and `private protected`, mentioned but deferred) the one genuinely new addition in this chapter. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`public`** — accessible from ALL classes. [S1]
- **`private`** — accessible ONLY within the same class. [S1]
- **`protected`** — accessible within the same class OR classes that inherit from it (full detail deferred to Inheritance). [S1]
- **`internal`** — accessible only within its own ASSEMBLY, not from another assembly (detail deferred; no equivalent concept in C/C++ covered so far in this series). [S1]
- **Combined modifiers** — `protected internal` and `private protected` exist but aren't covered in depth here. [S1]
- **Default access = private** — if no access modifier is specified on a class member, it defaults to `private`. [S1]
- **Purpose** — controls visibility/security of class members, and enables Encapsulation (hiding sensitive data by making fields private, deferred to the next chapter). [S1]
## 📖 세부 내용 (Details)
- Private field, accessed from WITHIN its own class: works fine, prints `"Mustang"`. [S1]
- Private field, accessed from a DIFFERENT class (`Program`): compile error — `'Car.model' is inaccessible due to its protection level`. [S1]
- Public field, accessed from a different class: works, prints `"Mustang"`. [S1]
- Implicit private default: `class Car { string model; string year; }` — both fields are private even though no keyword is written. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **기본 접근 수준(private)은 C++와 동일**: 접근 제한자를 명시하지 않으면 private가 기본값이라는 규칙이 Topic_CPP의 Access Specifiers 챕터에서 확인된 규칙과 차이가 없다는 점이 확인됨. [S1]
- **internal은 C/C++에 대응 개념이 없는 새로운 접근 수준**: "같은 어셈블리 내에서만 접근 가능, 다른 어셈블리에서는 불가"라는 internal의 정의는 .NET의 컴파일 단위인 어셈블리 개념에 의존하며, 이 시리즈의 C/C++ 챕터에는 대응하는 개념이 없었다는 점이 새로운 차이로 확인됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
private 필드를 같은 클래스 안에서 접근할 때는 성공하고, 다른 클래스(Program)에서 접근하면 컴파일 에러가 나는 것을 대비해 보여주는 예제가 원문에서 직접 실전 활용 사례로 제시됨. [S1]
## 💻 코드 패턴 (Code patterns)
private field inaccessible from another class — compile error (C#):
```csharp
class Car
{
private string model = "Mustang";
}
class Program
{
static void Main(string[] args)
{
Car myObj = new Car();
Console.WriteLine(myObj.model);
// Error: 'Car.model' is inaccessible due to its protection level
}
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.85
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[C# Tutorial]]
- **관련 개념:** [[CSharp Constructors]], [[CSharp Properties]], [[CPP Access Specifiers]]
- **참조 맥락:** Access Modifiers & Properties 섹션 — Properties (Get and Set) 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — C# Access Modifiers — https://www.w3schools.com/cs/cs_access_modifiers.php
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "C# Access Modifiers" page (Astra wiki-curation, P-Reinforce v3.1 format).