2007年8月18日
摘要: 实现IEnumerable接口的类可以进行简单迭代,例如foreach语句 using System;using System.Collections.Generic;using System.Text;using System.Collections;namespace IEnumerable接口{ class Program { static void Main(st... 阅读全文
posted @ 2007-08-18 10:49 ATP.NET 阅读(848) 评论(0) 推荐(0) 编辑
摘要: 模型如下:生产线(型号A)———〉生产汽车(型号A)———〉测试汽车(型号A)要求:当更换生产线时对程序的改动要尽可能的少 using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1{ class Program { static void Ma... 阅读全文
posted @ 2007-08-18 10:32 ATP.NET 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 先列个大体框架吧 using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication11{ class Program { static void Main(string[] args) { throw new MY("... 阅读全文
posted @ 2007-08-18 10:26 ATP.NET 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 类中有抽象的方法,此类即为抽象类,抽象方法必须在子类中被重写 using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication10{ class Program { static void Main(string[] args) { ... 阅读全文
posted @ 2007-08-18 10:23 ATP.NET 阅读(209) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication9{ class Program { static void Main(string[] args) { employee a = new employe... 阅读全文
posted @ 2007-08-18 10:20 ATP.NET 阅读(185) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication8{ class Program { static void Main(string[] args) { } } class class1 { ... 阅读全文
posted @ 2007-08-18 10:15 ATP.NET 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 再发生异常后,保持对程序的控制力 using System;using System.Collections.Generic;using System.Text;namespace 异常捕获{ class Program { static void Main(string[] args) { int a = 1; ... 阅读全文
posted @ 2007-08-18 10:12 ATP.NET 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Hashtable在命名空间using System.Collections中,实现基于键值的查找很方便 using System;using System.Collections.Generic;using System.Text;using System.Collections;namespace 哈希表{ class Program { static void Ma... 阅读全文
posted @ 2007-08-18 10:08 ATP.NET 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 只说明一点,枚举类型实际上和int型是对应的,我们看一个例子 using System;using System.Collections.Generic;using System.Text;namespace 枚举{ class Program { static void Main(string[] args) { int i = C... 阅读全文
posted @ 2007-08-18 09:47 ATP.NET 阅读(175) 评论(0) 推荐(0) 编辑