1.关于重载,下面是一道重载的问题(其实也就是考察dynamic的认知。另外dynamic与object的一个区别,不应该仅仅存在于安全检查)
namespace ConsoleApp1 { class Program { public static void RCFunc(object o_a,object o_b) { Console.WriteLine("O_O"); } public static void RCFunc(string s_a, string s_b) { Console.WriteLine("S_S"); } public static void RCFunc(string s_a, object o_b) { Console.WriteLine("S_O"); } public static void RCFunc(object o_a, string s_b) { Console.WriteLine("O_S"); } static void Main(string[] args) { object a = "Fir"; dynamic b = "Sec"; RCFunc(a, b); Console.ReadKey(); } } }