I thought that there was some way in .net 3.0 to give an array list a type so that it didnt just return Object's but I'm having trouble doing so. Is it possible? If so, how?
List<T>
was introduced with generics in .NET 2.0:
using System.Collections.Generic;
var list = new List<int>();
list.Add(1);
list.Add("string"); //compile-time error!
int i = list[0];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With