| using System;
class App {
public static void Main(){
BankAccount ba1 = new BankAccount("George", 1000.0M, 0.01),
ba2 = new CheckAccount("Bill", 2000.0M, 0.01);
CheckAccount ca = new CheckAccount("John", 2000.0M, 0.01);
if (ba1 is BankAccount)
Console.WriteLine("ba1 is BankAccount");
else
Console.WriteLine("ba1 is NOT BankAccount");
if (ba1 is CheckAccount)
Console.WriteLine("ba1 is CheckAccount");
else
Console.WriteLine("ba1 is NOT CheckAccount");
if (ba2 is BankAccount)
Console.WriteLine("ba2 is BankAccount");
else
Console.WriteLine("ba2 is NOT BankAccount");
if (ba2 is CheckAccount)
Console.WriteLine("ba2 is CheckAccount");
else
Console.WriteLine("ba2 is NOT CheckAccount");
if (ca is BankAccount)
Console.WriteLine("ca is BankAccount");
else
Console.WriteLine("ca is NOT BankAccount");
if (ca is CheckAccount)
Console.WriteLine("ca is CheckAccount");
else
Console.WriteLine("ca is NOT CheckAccount");
}
} |