Polymorphism in C# 5.0

Polymorphism is one of the primary concepts of Object Oriented Programming. There are basically two types of polymorphism (i) RunTime (ii) CompileTime. Overriding a virtual method from a parent class in a child class is RunTime polymorphism while CompileTime polymorphism consists of overloading identical functions with different signatures in the same class. This program depicts Run Time Polymorphism.

The method Calculate(int x) is first defined as a virtual function int he parent class & later redefined with the override keyword. Therefore, when the function is called, the override version of the method is used.

Properties in C#

Properties are used to encapsulate the state of an object in a class. This is done by creating Read Only, Write Only or Read Write properties. Traditionally, methods were used to do this. But now the same can be done smoothly & efficiently with the help of properties. 

Class Inheritance

Classes can inherit from other classes. They can gain Public/Protected Variables and Functions of the parent class. The class then acts as a detailed version of the original parent class(also known as the base class). 
The code below shows the simplest of examples :

public class A
{
    //Define Parent Class
    public A() { }
}

public class B : A
{
    //Define Child Class
    public B() { }
}