static void Swap<T>(ref T a, ref T b)
        {
            T t;
            t = a;
            a = b;
            b = t;
        }
        static void Main(string[] args)
        {
            string a = \”abc\”;
            string b = \”123\”;
            Swap<string>(ref a, ref b);
            Console.WriteLine(\”a={0},b={1}\”, a, b);
            Console.ReadLine();
        }
C#学习.使用泛型进行数据交换
未经允许不得转载:爱站程序员基地 » C#学习.使用泛型进行数据交换
		
					
		
		
		
		
		            
        
									 爱站程序员基地
爱站程序员基地
![(原创)[C#] 一步一步自定义拖拽(Drag&Drop)时的鼠标效果:(一)基本原理及基本实现-爱站程序员基地](https://aiznh.com/wp-content/uploads/2022/07/20220721231016-62d9dcd85c40b-220x150.gif)

