static void Main(string[] args) { Console.WriteLine("***Concept of method Overloading***\n\n"); OverloadEx1 ob = new OverloadEx1(); Console.WriteLine("2+3={0}", ob.Add(2, 3)); Console.WriteLine("20.5+30.7={0}", ob.Add(20.5, 30.7)); Console.WriteLine("Amit + Bose ={0}", ob.Add("Amit", "Bose")); Console.ReadKey(); }
static void Main(string[] args) { Console.WriteLine("*** メソッドのオーバーロードという考え方 ***"); OverloadEx1 ob = new OverloadEx1(); Console.WriteLine("2+3={0}", ob.Add(2, 3)); Console.WriteLine("20.5+30.7={0}", ob.Add(20.5, 30.7)); Console.WriteLine("Amit + Bose={0}", ob.Add("Amit", "Bose")); Console.ReadKey(); }