C#/기본 문법
2025. 11. 2.
C# 상속성
객체지향(OOP) : 은닉성, 상속성, 다형성 Mage, Archer, Knight 클래스의 부모인 Player 클래스를 생성부모(기반) 클래스 : Player자식(파생) 클래스 : Mage, Archer, Knight 공통된 속성(필드), 함수를 부모에 정의class Player // 부모(기반) 클래스{ public int id; public int hp; public int attack; public Player() { Console.WriteLine("Player 생성자 호출!"); } public Player(int hp) { this.hp = hp; Console.WriteLine("Player hp 생성자 호출!..