泛型类的一个简单示例
来源:互联网 发布:公安部 2017年欺诈数据 编辑:程序博客网 时间:2024/05/15 22:09
using System;using System.Collections;using System.Text;namespace Generics{ public class aList<T> : CollectionBase where T:new () { public aList(){ } public T this[int index]{ get { return (T)List[index]; } set { List[index] = value; } } public int Add(T value){return List.Add(value);} } class Program { static void Main(string[] args) { aList<Customer> customers = new aList<Customer>(); customers.Add(new Customer("Motown-Jobs")); customers.Add(new Customer("Fatman's")); foreach (Customer c in customers) Console.WriteLine(c.CustomerName); Console.ReadLine(); } } public class Customer { private string customerName = ""; public string CustomerName { get { return customerName; } set { customerName = value; } } public Customer(string customerName) { this.customerName = customerName; } public Customer() { } }}
- 泛型类的一个简单示例
- 一个简单的破解示例
- SpringJdbc的一个简单示例
- 一个简单的iBatis示例
- ActiveMQ的一个简单示例
- 简单的一个AJAX示例
- 一个简单的makefile示例
- ActiveMQ的一个简单示例
- 一个简单的学习示例
- 一个简单的JNI示例
- 一个简单的Makefile示例
- 一个简单的WCF示例
- 一个简单的Servlet示例
- nutz的一个简单示例
- 一个简单的多线程示例
- 一个简单的Makefile示例
- 一个简单的死锁示例
- 一个简单的CMake示例
- gdb入门
- Project management
- Software Requirements
- Requirements Engineering Processes
- annotations 中文 文档 下载
- 泛型类的一个简单示例
- Google Summer of Code 2008
- 相关资料
- Architectural Design
- MFC应用程序中浏览PDF、Word文件
- 修改mysql字符集
- 请问我现在用的这个发表文章是怎么做出来的
- .NET和SQL Server中“空值”辨析
- Winofrm中帮助的使用说明