Lists: Better than Arrays
While arrays have a fixed size, List<T> can grow or shrink dynamically.
Usage:
csharp using System.Collections.Generic;
List
Console.WriteLine(fruits.Count);
T represents the type of data (int, string, User, etc.).
.NET Zero to Hero: Master C# and Modern App Development
While arrays have a fixed size, List<T> can grow or shrink dynamically.
csharp using System.Collections.Generic;
List
Console.WriteLine(fruits.Count);
T represents the type of data (int, string, User, etc.).