我知道这一点很简单,但我可以说出这一点。 我创造一等,我的职责是给我带来问题。 I m将O Reillys C# 3.0作为参考。
我设立了一个班子:
class Runner
{
public double miles = 0;
public double RunMiles
{
get { return miles; }
set
{
if ((value > 2)&&(value <7))
{
this.miles = value;
}
}
}
public void StartRun ()
{
// here, I want to enable the runner to start running, Make him start running//if that makes any sense.
}
public void VerifyMiles ()
{
// enter code here//I want to verify the miles are set.
}
}