Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- private static readonly TestStruct _Account = new TestStruct();
- static void Main(string[] args)
- {
- Console.WriteLine(_Account.MyMoney);
- _Account.UpdateValue(100);
- Console.WriteLine(_Account.MyMoney);
- Console.WriteLine("Hello World!");
- }
- public class TestStruct
- {
- private int _money;
- public int MyMoney => _money;
- public void UpdateValue(int moneyAmount)
- {
- _money += moneyAmount;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement