class Program
{
static void Main(string[] args)
{
Car car = new Car();
car.DoSmothing(120);
Console.WriteLine(car.Speed);
Console.Read();
}
class Car
{
private double speed;
public void DoSmothing(int sp)
{
this.speed = sp;//为什么还可给只读字段赋值?
}
public double Speed
{
get
{
return speed;
}
}
}
}
慕侠2389804
慕姐4208626
慕姐8265434
繁星点点滴滴
眼眸繁星
达令说
千万里不及你
相关分类