Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 안드로이드
- Java
- varags
- 자바스크립트
- C#
- Android
- MSsql
- Web Service
- WebView
- 웹뷰
- MANTIS
- html
- TextBox
- Eclipse
- SpringSource Tool Suite
- Maven
- STS
- decompiler
- Bootstrap
- Apache Lucene
- javascript
- jsp
- 자바
- 웹 서비스
- 컬럼명
- 이클립스
- MS-SQL
- scrollView
- Redirect
- asp.net
Archives
- Today
- Total
bboks.net™
C# const, readonly, sealed의 차이점 본문
sealed
class modifier
클래스를 더이상 상속할수 없게 만들고 싶은때 사용
[attributes] sealed class identifier [class-base] class-body [;]
const
필드나 로컬 변수의 선언을 변경하는데 사용한다.
const 로 선언된 필드나 로컬 변수는 변경될 수 없음을 지정한다.
[attributes] [modifiers] const type declarators;
readonly
const 와 역활은 같지만 초기화방법이 조금 차이가 있다.
선언과 동시에 초기화 할 수도 있고 생성자등에서 초기화가 가능한다.
즉 const는 compile time의 constant이고 readonly는 runtime에 constant로 사용될 수 있다.
[출처] const, readonly, sealed의 차이점
class modifier
클래스를 더이상 상속할수 없게 만들고 싶은때 사용
[attributes] sealed class identifier [class-base] class-body [;]
const
필드나 로컬 변수의 선언을 변경하는데 사용한다.
const 로 선언된 필드나 로컬 변수는 변경될 수 없음을 지정한다.
[attributes] [modifiers] const type declarators;
readonly
const 와 역활은 같지만 초기화방법이 조금 차이가 있다.
선언과 동시에 초기화 할 수도 있고 생성자등에서 초기화가 가능한다.
즉 const는 compile time의 constant이고 readonly는 runtime에 constant로 사용될 수 있다.
[출처] const, readonly, sealed의 차이점