Files
2nd/10_Wiki/Dev/Topic_CSharp/CSharp_Classes.md
T
Antigravity Agent 1cfd3bbb56 docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
2026-07-05 00:10:59 +09:00

4.2 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
csharp-classes C# Classes and Objects Programming_Language draft conceptual
new keyword objects C#
field C#
C# 클래스와 객체
B 0.84 2026-07-04 2026-07-04
csharp
programming-language
w3schools
oop
classes
https://www.w3schools.com/cs/cs_classes.php

CSharp Classes

🎯 한 줄 통찰 (One-line insight)

The chapter's own explicit aside — "it is common that the name of the C# file and the class matches... However it is not required (like in Java)" — directly repeats the exact comparison already flagged in the Syntax chapter, meaning W3Schools' C# tutorial itself considers this Java contrast important enough to state TWICE across the series; the object-creation syntax Car myObj = new Car(); is otherwise structurally identical to C++'s heap-allocation new (though C# never requires a matching delete — memory is garbage-collected, a fact not yet stated in this chapter but implied by its complete absence). [S1]

🧠 핵심 개념 (Core concepts)

  • class keyword — defines a class, e.g. class Car { string color = "red"; }. [S1]
  • Field — a variable declared directly inside a class; also called an "attribute". [S1]
  • Naming convention (again) — class names should start uppercase (good practice, not enforced); file name matching class name is common but, unlike Java, NOT required. [S1]
  • Object creationClassName objectName = new ClassName();, e.g. Car myObj = new Car();. [S1]
  • Dot syntaxmyObj.color accesses a field on an object instance. [S1]

📖 세부 내용 (Details)

  • Class with a field: class Car { string color = "red"; }. [S1]
  • Full object creation + field access example: class Car { string color = "red"; static void Main(string[] args) { Car myObj = new Car(); Console.WriteLine(myObj.color); } } → outputs "red". [S1]

⚖️ 모순 및 업데이트 (Contradictions & updates)

  • Java와의 파일명 대비가 시리즈에서 두 번째로 반복됨: Syntax 챕터에서 이미 "C#은 Java와 달리 파일명과 클래스명이 일치할 필요가 없다"고 언급했는데, 이번 Classes 챕터가 동일한 비교를 다시 명시적으로 반복한다는 점이 확인됨 — W3Schools가 이 차이를 중요하게 여겨 두 번 강조. [S1]
  • new 키워드는 C++와 문법이 같지만 delete 짝이 없음: new Car()가 C++의 힙 할당 new와 문법상 동일해 보이지만, 이 챕터(그리고 이후 챕터들)에서 delete에 대응하는 언급이 전혀 등장하지 않는다는 점이 확인됨 — C#의 가비지 컬렉션 기반 메모리 관리를 암시(다만 이 챕터가 명시적으로 설명하지는 않음). [S1]

🛠️ 적용 사례 (Applied in summary)

Car 클래스에 color 필드를 정의하고, new로 객체를 만들어 점(.) 문법으로 필드 값을 출력하는 예제가 원문에서 직접 실전 활용 사례로 제시됨. [S1]

💻 코드 패턴 (Code patterns)

Class definition, object creation, and dot-syntax field access (C#):

class Car
{
    string color = "red";

    static void Main(string[] args)
    {
        Car myObj = new Car();
        Console.WriteLine(myObj.color);  // "red"
    }
}

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.84
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-07-04: Initial draft synthesized from the W3Schools "C# Classes and Objects" page (Astra wiki-curation, P-Reinforce v3.1 format).