using System;
namespace Ch10Ex01
{
/// <summary>
/// Summary description for MyClass.
/// </summary>
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() 请问这里的 override 是重写什么地方的方法的???
{
return "Name: " + Name + "\nVal: " + Val;
}
private MyClass() : this("Default Name") 这里的 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;
}
}
private double myDouble;
}
}