Q:

Polymorphism concept using C# Language

0

This Program is used to demonstrate Polymorphism concept.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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);

    }

 }

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now