생성자
-
생성자에서의 this 와 basePrograming/C# 2008. 8. 27. 12:36
생성자를 보면 가끔 this() 와 base()를 상속하는 경우를 종종 볼 수 있다. 과연..이게 멀까 고민하다가 적어둔다. 1. this - this는 객체 자신에 대한 참조값을 나타내는 값으로도 많이 사용되어 지는 키워드 이다. 이런 this 키워드는 생성자를 호출 할때도 사용되어 지는데 예를 들면 다음과 같다. public FPS(Game game) : this(game, false, true) { } public FPS(Game game, bool synchWithVerticalRetrace, bool isFixedTimeStep) : this(game, synchWithVerticalRetrace, isFixedTimeStep, game.TargetElapsedTime) { } public FP..