✅ get set help
i dont understand the application of a get set method. are there any practical examples you can give?
MyProperty and that gives the value of _myField_myFieldint MyProperty { get; set; }int MyProperty { get; private set; }private int _myField;
public int MyProperty
{
get => _myField;
set
{
if (value > 100)
throw new Exception("Number is too big");
_myField = value;
}
}