C Sharp (C#) - Properties and Encapsulation
What will be the output of the following C# code?
class Car {
private int speed;
public int Speed {
get { return speed; }
set { speed = value; }
}
}
Car c = new Car();
c.Speed = 50;
Console.WriteLine(c.Speed);