C Sharp (C#) - Properties and Encapsulation
Examine the code below:
What is the main problem with this code?
class Wallet {
private decimal amount;
public void SetAmount(decimal value) {
amount = value;
}
}
class Program {
static void Main() {
Wallet w = new Wallet();
w.amount = 500m;
}
}What is the main problem with this code?
