본문 바로가기

컴퓨터 과학 & 영상처리 관련/C# / .NET / JAVA

c# properties

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 ;}
}