C Sharp (C#) - Properties and Encapsulation
Identify the error in this C# code snippet:
class Account {
private string _pin;
public string Pin {
get { return _pin; }
set { _pin = value; }
}
}
var acc = new Account();
acc.Pin = "1234";
Console.WriteLine(acc.Pin);The goal is to make Pin write-only.
