Beispiel #1
0
        static void Main(string[] args)
        {
            difclass obj = new difclass();

            Console.WriteLine("value is {0}", obj.value);
            //自动选择了适合参数类型的重载函数
            ModifyValue(obj.value);
            Console.WriteLine("value2 is {0}", obj.value);
            ModifyValue(obj);
            Console.WriteLine(obj.value);
            obj.Addm();
            obj.dispva();
            //Console.WriteLine();
            Console.ReadKey();
        }
Beispiel #2
0
 //引用类型,重载函数,参数类型不一致
 static void ModifyValue(difclass obj)
 {
     obj.value += 2;
 }