C Sharp (C#) - Properties and Encapsulation
What will be the output of this C# code?
class Box {
private int length;
public int Length {
get { return length; }
private set { length = value; }
}
public Box(int len) {
Length = len;
}
}
Box b = new Box(10);
Console.WriteLine(b.Length);