C#

Polymorphism concept using C# Language.

Polymorphism concept using C# Language.
using System;

.

public class shape  

 {

   public void area(double r)

    {

       double a;

       a = (3.14 * r * r);

       Console.WriteLine("\nArea  of Circle is : {0}",a);

    }

   public void area(double b, double h)

    {

       double a1;

       a1 = (0.5 * b * h);

       Console.WriteLine("\nArea  of Triangle is : {0}",a1);

    }



   public static void Main()

    {

      shape s = new shape();

      s.area(3.2);

      s.area(4,5);

    }

 }
Senthilvelan Sambamoorthy

Senthilvelan Sambamoorthy is working as a Professor in Department of Master of Computer Applications, Paavai Engineering College, Namakkal, Tamilnadu, India, He is Masters in Computers Applications. Having 18+ years of experience and his area of interest is Java, JSP, Servlet, J2EE, C#, PHP, Python ASP.NET, SQL Server and etc.