C#方法重载


using System;
namespace HxRuntech
{
    public class T1
    {
        static void Main()
        {
            int a = 10;
            int b = 10;

            float c = 17f;
            float d = 19.5f;

            int ab = Sum(a, b);

            float cd = Sum(c, d);

            Console.WriteLine(ab);
            Console.WriteLine(cd);
        }
        static int Sum(int a,int b)
        {
            return a + b;
        }

        static float Sum(float a,float b)
        {
            return a + b;
        }
        
    }
}