class myExample{
private int someVal; //private data field
public int CurrentValue{
get { return someVal;}
set { someVal = value;} //value is implicit
//if no "set " defined = property is write-only
}
}
-> automatic properties:
could be rewritten as ...
class myExample{
public int CurrentValue { get; set ;}
}
'컴퓨터 과학 & 영상처리 관련 > C# / .NET / JAVA' 카테고리의 다른 글
c# collections (dictionaries - the hashtable) (0) | 2012.02.03 |
---|---|
c# value types compared to reference types (0) | 2012.02.03 |
c# access modifier (0) | 2012.02.03 |
c# char upper 사용법 (0) | 2012.02.02 |
c# is operator (0) | 2012.02.02 |