Tag

generic collections

All blogs tagged with generic collections

1
Articles
3,206
Total Views

Showing 1 of 1 articles

09
Dec
2023
Complete Guide to Lists in C#: Examples and Best Practices
3,206 views

C# List<T> class is used to store and fetch elements. It can also have duplicate elements. It is found in System.Collections.Generic namespace. List<T> class in C# represents a strongly typed list of objects. List<T> provides functionality to create a list of objects, find list items, sort list, search list, and manipulate list items. In List<T>, T is the type of object. What is the ‘T’ in List<T>? List<T> class represents a strongly typed list of objects. List<T> provides functionality to create a list of objects, find list items, sort list, search list, and manipulate list items. In List<T>, T is the type of objects. How to create List in C#? List is a generic class and is defined in the System.Collections.Generic namespace. You must import this namespace in your project to access the List<T> class. using System.Collections.Generic; The List<T> is a generic collection, so you need to specify a type parameter for the type of data it can store. The following example shows how to create a list and add elements.

Code2Night

A community platform for sharing programming knowledge, tutorials, and blogs. Learn, write, and grow with developers worldwide.

Panipat, Haryana, India
info@code2night.com
© 2026 Code2Night. All Rights Reserved.
Made with for developers  |  Privacy  ·  Terms
Translate Page