h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Using Overloading method via Interface in C#.Net

Here the Example for Using Overloading method via Interface in C#.Net

Interface Name: IFamily
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FactoryPattern
{
    interface IFamily
    {
        string DisplayName(string str);
    }
}
Interface Name: IFamilyMember
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FactoryPattern
{
    interface IFamilyMembers
    {
        string DisplayFamilyMembers(string str);
        string DisplayName();

    }
}
ClassName: ClsFamily
Interface Name(s):IFamily ,IFamilyMembers
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FactoryPattern
{
    class ClsFamily :IFamily ,IFamilyMembers
    {
        public string DisplayName(string str)
        {
            return str;
        }
        public string DisplayFamilyMembers(string str)
        {
            return str;
        }
        public string DisplayName()
        {
            return "Good";
        }
    }
}
Class Declaration and Call Methods
  ClsFamily obj = new ClsFamily();
   MessageBox.Show(obj.DisplayName("Naraayanan"));
   MessageBox.Show(obj.DisplayFamilyMembers("Naraayanan"));            MessageBox.Show(obj.DisplayName());