cjswocl32532984
@cjswocl32532984
Reviews Written
-
Average Rating
-
Posts
Q&A
์ ๊ทผํ์ ์์ ๋ํด์ ์ง๋ฌธ์์ด์
๋ต๋ณ ๊ฐ์ฌํฉ๋๋ค!! ๊ฐ์ฒด์งํฅ์ด ๋ญ๊ฐ ๋ง์ด ์ด๋ ต๋ค์..ใ ใ ๋ต๋ณ ๊ณ์ ๊ณฑ์น์ด๋ณด๋ฉด์ ์ด๊ณตํ๊ฒ ์ต๋๋ค~!!
- 1
- 4
- 330
Q&A
์ ๊ทผํ์ ์์ ๋ํด์ ์ง๋ฌธ์์ด์
์..์ง๋ฌธ์ ์๋ชปํ์์ด์..์ฃ์กํฉ๋๋ค. class Player { protected PlayerType type; protected int hp; protected int attack; protected int GetHp() { return this.hp; } protected void SetInfo(int hp, int attack) { this.hp = hp; this.attack = attack; } } class Knight : Player { public Knight() { SetInfo(100, 10); } } ์ด๋ ๊ฒ ์์ํด๋์ค์์๋ ํจ์์ฌ์ฉ์ด ๊ฐ๋ฅํ๋ฐ mainํจ์์์ Knight knight = new Knight(); knight.GetHp(); ์ด๋ ๊ฒํ๋ฉด ๋ณดํธ์์ค์๋ฌ๊ฐ ๋จ๋๋ผ๊ตฌ์.. Knight๋ Player์๊ฒ ์์๋ฐ๊ณ knight๋ Knight์ ์ธ์คํด์ค๋๊น ์ฌ์ฉ๋ ๊ฒ๊ฐ์๋ฐ..์ ์๋๋๊ฑด๊ฐ์..?
- 1
- 4
- 330




