Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. class Program
  2. {
  3. private static readonly TestStruct _Account = new TestStruct();
  4.  
  5. static void Main(string[] args)
  6. {
  7. Console.WriteLine(_Account.MyMoney);
  8. _Account.UpdateValue(100);
  9. Console.WriteLine(_Account.MyMoney);
  10.  
  11. Console.WriteLine("Hello World!");
  12. }
  13.  
  14. public class TestStruct
  15. {
  16. private int _money;
  17. public int MyMoney => _money;
  18.  
  19. public void UpdateValue(int moneyAmount)
  20. {
  21. _money += moneyAmount;
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement