Back to notes -- Keyboard shortcut: 'u'  previous -- Keyboard shortcut: 'p'  next -- Keyboard shortcut: 'n'  Slide program -- Keyboard shortcut: 't'    Adding interests without use of dynamic binding - AddInterest is not virtual.Lecture 7 - slide 36 : 40
Program 2
using System;

public class AccountClient{

  public static void Main(){
     BankAccount[] accounts = 
      new BankAccount[5]{
        new CheckAccount("Per",1000.0M, 0.03),
        new SavingsAccount("Poul",1000.0M, 0.03),
        new CheckAccount("Kurt",1000.0M, 0.03),
        new LotteryAccount("Bent",1000.0M),
        new LotteryAccount("Lone",1000.0M)

    foreach(BankAccount ba in accounts){
      if (ba is CheckAccount)
      else if (ba is SavingsAccount)
      else if (ba is LotteryAccount)
      else if (ba is BankAccount)

    foreach(BankAccount ba in accounts){
      Console.WriteLine("{0}", ba);