110,546
社区成员
发帖
与我相关
我的任务
分享
class Date
{
private int _Month = 1;
public int Month
{
get { return _Month; }
set
{
if (value < 1 || value > 12) throw new Exception("invalid month");
_Month = value;
}
}
...
}