Match overloaded method by variable size - CSharp Custom Type

CSharp examples for Custom Type:overload

Description

Match overloaded method by variable size

Demo Code

using System;/*from  www.  j  a va 2  s  .c om*/
class MethodMatcherTwo
{
   public void DoIt (uint x)
   {
      Console.WriteLine("Executing uint: " + x);
   }
   public void DoIt (int x)
   {
      Console.WriteLine("Executing int: " + x);
   }
}
class Tester
{
   public static void Main()
   {
      MethodMatcherTwo myMatcher = new MethodMatcherTwo();
      byte byteValue = 10;
      Console.Write("Calling with a byte value --> ");
      myMatcher.DoIt(byteValue);
   }
}

Result


Related Tutorials