摘要: 1.飞机会飞,鸟会飞,他们都继承了同一个接口“飞”;但是F22属于飞机抽象类,鸽子属于鸟抽象类;2. 就像铁门木门都是门(抽象类),你想要个门我给不了(不能实例化),但我可以给你个具体的铁门或木门(多态);而且只能是门,你不能说它是窗(单继承),一个门可以有锁(接口)也可以有门铃(多实现)。门(抽象类)定义了你是什么,接口(锁)规定了你能做什么(一个接口最好只能做一件事,你不能要求锁也能发出声音吧(接口污染))。from互联网网友 阅读全文
posted @ 2012-12-26 15:49 Tlink 阅读(214) 评论(1) 推荐(1)
摘要: 所属命名空间:using System.Collections.Generic; List<T>类是 ArrayList 类的泛型等效类。 该类使用大小可按需动态增加的数组实现 IList<T> 泛型接口。泛型的好处: 它为使用 c#语言编写面向对象程序增加了极大的效力和灵活性。不会强行对值类型进行装箱和拆箱,或对引用类型进行向下强制类型转换,所以性能得到提高。一、 List的基础、常用方法:1、List<T> mList = new List<T>(); a.T为列表中元素类型,现在以string类型作为例子如: List<string& 阅读全文
posted @ 2012-12-06 16:56 Tlink 阅读(355) 评论(0) 推荐(0)
摘要: 原文地址:hoojo高级查询在数据库中用得是最频繁的,也是应用最广泛的。Ø 基本常用查询--selectselect * from student;--all 查询所有select all sex from student;--distinct 过滤重复select distinct sex from student;--count 统计select count(*) from student;select count(sex) from student;select count(distinct sex) from student;--top 取前N条记录select top 3 阅读全文
posted @ 2012-12-03 10:35 Tlink 阅读(295) 评论(0) 推荐(0)