只有只读属性的字段还可以给字段赋值,那只读还有什么意义?

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;
            }
        }
    }
}
查看回复