Maha

Maha

  • NA
  • 0
  • 326.1k

Runtime polymorphism

Sep 16 2012 11:02 AM
This program is in the following website http://www.c-sharpcorner.com/uploadfile/bubbles4800/polymorphism-in-C-Sharp/. Why the output is saying that "This is not Runtime polymorphism".

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace ConsoleApplication2
{
public class Polymorphism
{
public virtual void DisplayName()
{
Console.WriteLine("This is Runtime polymorphism");
}
}
class Polymorphism1 : Polymorphism
{
public override void DisplayName()
{
Console.WriteLine("This is not Runtime polymorphism");
}
}
class Program
{
static void Main(string[] args)
{
Polymorphism1 obj = new Polymorphism1();
obj.DisplayName();
Console.ReadKey();
}
}
}
//This is not Runtime polymorphism

Answers (2)