반응형 SMALL RPG1 간단한 RPG 캐릭터 설계 목표Character라는 부모 클래스 만들기Warrior, Wizard 등 자식 클래스에서 상속공격, 이동, 특수 스킬 등의 메서드를 구현1. 부모 클래스 Characterpublic class Character { String name; int hp; public Character(String name, int hp) { this.name = name; this.hp = hp; } public void move() { System.out.println(name + "이(가) 이동합니다."); } public void attack() { System.out.println(name + "이(가) 기본 공격을 합니다!").. 2025. 4. 13. 이전 1 다음 LIST