Example #1
0
        public static void DisplayTest()
        {
            // Compare property and method notation
            // using SimpleAccount class
            SimpleAccount acc = new SimpleAccount();
            decimal       bal;

            bal = acc.Balance;
            // bal = acc.GetBalance();
            acc.Balance  = 100m;
            acc.Balance += 1m;
            // acc.SetBalance(acc.GetBalance() + 1m);
            ShowAccount(acc);
        }
Example #2
0
 private static void ShowAccount(SimpleAccount acc)
 {
     Console.WriteLine("balance: {0:C}", acc.Balance);
 }