본문 바로가기
C++ 200제/코딩 IT 정보

C# 일반, static, sealed, abstract 클래스 차이점

by vicddory 2017. 7. 20.

C# 일반, static, sealed, abstract 클래스 차이점


Class 타입

 일반

 static

 sealed

 abstract

 객체 생성

 YES

 NO

 YES

 NO

 상속

 YES

 NO

 NO

 YES

 상속 (다른곳)

 YES

 NO

 YES

 YES


그리고 sealed 클래스는 다른 클래스로 상속될 수 없습니다. 오로지 다른 클래스를 상속받는 것만 할 수 있습니다.


1
2
3
sealed class MySealedClass : BaseClass // is ok
 
class MyOtherClass : MySealedClass     // won't compile
cs



추신.

위 표가 잘린다면 아래 그림을 보세요.


C# 클래스 차이점C# 클래스 차이점. 그림 파일


C# 일반, static, sealed, abstract 클래스 차이점

댓글