Ejemplo n.º 1
0
        static void Main(string[] args) {

            // create a bank account with the default balance
            ImmutableBankAccount bankAccount1 = new ImmutableBankAccount();
            Console.WriteLine("Account Number: {0}, Account Balance: {1}",
                ImmutableBankAccount.AccountNumber, bankAccount1.Balance);

            // create a bank account with a starting balance
            ImmutableBankAccount bankAccount2 = new ImmutableBankAccount(200);
            Console.WriteLine("Account Number: {0}, Account Balance: {1}",
                ImmutableBankAccount.AccountNumber, bankAccount2.Balance);

            // wait for input before exiting
            Console.WriteLine("Press enter to finish");
            Console.ReadLine();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            // create a bank account with the default balance
            ImmutableBankAccount bankAccount1 = new ImmutableBankAccount();

            Console.WriteLine("Account Number: {0}, Account Balance: {1}",
                              ImmutableBankAccount.AccountNumber, bankAccount1.Balance);

            // create a bank account with a starting balance
            ImmutableBankAccount bankAccount2 = new ImmutableBankAccount(200);

            Console.WriteLine("Account Number: {0}, Account Balance: {1}",
                              ImmutableBankAccount.AccountNumber, bankAccount2.Balance);

            // wait for input before exiting
            Console.WriteLine("Press enter to finish");
            Console.ReadLine();
        }