服务于区块链开拓者

www.zhidnet.com

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年12月6日

摘要: 1 数组是引用类型的变量,元素保存在托管堆中元素的引用保存在栈中。交错数组和矩形数组的使用格式如下: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ArrayTest 7 { 8 class Program 9 {10 static void Main(string[] args)11 {12 string[][] array=new string[2]... 阅读全文
posted @ 2012-12-06 17:01 知点网 阅读(244) 评论(0) 推荐(0)

摘要: System;using System.Collections.Generic;using System.Linq;using System.Text;namespace XNdemo{ class Program { static void Main(string[] args) { ISample<ChildClass> child = new Sample<ChildClass>(); ISample < BaseClass > baseclusing ass = child;//协变 ... 阅读全文
posted @ 2012-12-06 14:14 知点网 阅读(210) 评论(0) 推荐(0)

摘要: 扩展方法必须是静态的方法,并且扩展方法必须定义在静态的类中。但是不是通过静态类名.静态方法的形式调用该扩展方法。而是像类的实例调用类中的成员方法一样去调用扩展方法。和类中的实例方法的调用形式是一样的。并且扩展方法只能有实例调用,业就是说目标类不能是静态类使用格式如下: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ExtendsMethod 7 { 8 class ExtendsMethod 9 {10 ... 阅读全文
posted @ 2012-12-06 10:44 知点网 阅读(239) 评论(0) 推荐(0)