上一页 1 ··· 15 16 17 18 19
摘要: class Program { static void Main(string[] args) { Person p1 = new Person("张三"); Person p2 = new Person("李思思"); Console.WriteLine(p1.CompareTo(p2)); Ca 阅读全文
posted @ 2015-04-14 16:42 江境纣州 阅读(56) 评论(0) 推荐(0)
摘要: 以前知道where T:class 和where T:struct的作用是约束T是自定义类类型还是值类型; 还有就是where T:new()的作用是约束必须有一个无参的构造函数。 但是对于where T:IFoo和where T:Foo,就只知道有这么一个约束,自己也没深入研究过,而且自己写的泛型 阅读全文
posted @ 2015-04-14 16:29 江境纣州 阅读(99) 评论(0) 推荐(0)
摘要: class Program { static void Main(string[] args) { int i = Calculator.Add(1, 2); double d = Calculator.Add(1.2, 3.2); string s = Calculator.Add("ab", " 阅读全文
posted @ 2015-04-13 16:53 江境纣州 阅读(48) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19