C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
C# CollectionsIn C#, collection represents group of objects. By the help of collections, we can perform various operations on objects such as
In sort, all the data structure work can be performed by C# collections. We can store objects in array or collection. Collection has advantage over array. Array has size limit but objects stored in collection can grow or shrink dynamically. Types of Collections in C#There are 3 ways to work with collections. The three namespaces are given below:
1) System.Collections.Generic classesThe System.Collections.Generic namespace has following classes:
2) System.Collections classesThese classes are legacy. It is suggested now to use System.Collections.Generic classes. The System.Collections namespace has following classes:
3) System.Collections.Concurrent classesThe System.Collections.Concurrent namespace provides classes for thread-safe operations. Now multiple threads will not create problem for accessing the collection items. The System.Collections.Concurrent namespace has following classes:
Next TopicC# List
|