Search your topic here

Static polymorphism in C#

PRINCIPLES OF PROGRAMMING LANGUAGES
PRACT. Implement static/runtime polymorphism in C#.

using System;

namespace ATC
{
    public class ATC
    {
        void Show(int a)
        {
            Console.WriteLine("int a = {0}",a);
        }
        void Show(double a)
        {
            Console.WriteLine("double a= {0}", a);
        }
        static void Main(string[] args)
        {
            ATC obj = new ATC();
            obj.Show(5);
            obj.Show(5.5);
            Console.ReadKey();
        }
    }           
}

LEAVE A REPLY










Related topics

Please use contact page in this website if you find anything incorrect or you want to share more information about the topic discussed above.