如题,帮我加个注释或者代码说明……
public class MyClass
{
public readonly string Name;
private int intVal;
public int Val
{
get
{
return intVal;
}
set
{
if (value >= 0 && value <= 10)
intVal = value;
else
throw (new ArgumentOutOfRangeException("Val", value,
"Val must be assigned a value between 0 and 10."));
}
}
public override?? string ToString()
{
return "Name: " + Name + "\nVal: " + Val;
}
private MyClass() : this("Default Name")??构造函数加了参数 什么意思
{
}
public MyClass(string newName)
{
Name = newName;
intVal = 0;
}
public void myMethod(double paramX, double paramY)
{
}
public static int myInt
{
get
{
return 0; ??这里是给 myInt赋值为0吗?
}
}
private double myDouble;
}