Can I have fixed typed ArrayList in C#, just like C++?

来源:互联网 发布:paxos算法 活锁 编辑:程序博客网 时间:2024/06/05 15:40

http://stackoverflow.com/questions/2360747/can-i-have-fixed-typed-arraylist-in-c-just-like-c

You could use a List. The List class takes advantage of generics to make a strongly typed collection.

To use, just call new List< Type you want to use >() like this:

List<string> myStringList = new List<string>();

MSDN has a quick article on some ways you can make collections thread safe.


0 0
原创粉丝点击