Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

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

1 thought on “Static polymorphism in C#”

  1. Good day! Would you mind if I share your blog with my facebook group? There’s a lot of folks that I think would really enjoy your content. Please let me know. Cheers

Leave a Comment