06 2011 档案

摘要:using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;using System.IO;using Color = System.Drawing.Color;using Rectangle = System.Drawing.Rectangle;using RectangleF = System.Drawing.RectangleF;using Point = System.Drawing.Point;using PointF = System.Dra 阅读全文
posted @ 2011-06-27 09:31 SoarNo1 阅读(753) 评论(0) 推荐(0) 编辑
摘要:泛型很强大,下面我讲讲几种实例化泛型的方法,第一种,使用new 约束在类名或方法名后面 加上 where T : new()第二种, 使用default()方法声明时:T t1=default(T);第三种,使用 Activator.CreateInstance<T>();方法声明时:T t2= Activator.CreateInstance<T>();ok,介绍完毕new()约束 方法用起来比较麻烦 每次使用都要加 where T:new()其他两种,你自己研究了 阅读全文
posted @ 2011-06-15 15:58 SoarNo1 阅读(596) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示