【C#学习笔记】函数重载

using System;

namespace ConsoleApplication
{
    class Program
    {
        static void Print(int a, int b)
        {
            Console.Write(a + b);
        }

        static void Print(string a,string b)
        {
            Console.Write(a + b);
        }

        static void Main(string[] args)
        {
            Print(1, 2);
            Console.WriteLine();
            Print("1","2");
            Console.Read();
        }      
    }
}

 

posted @ 2017-08-27 15:08  Dsp Tian  阅读(394)  评论(0编辑  收藏  举报