Generics and Arrays
Posted on: Tue Jul 22 15:43:19 -0700 2008. Updated on: Tue Jul 22 15:46:55 -0700 2008.
Category: DotNet
Category: DotNet
Quick how to on using generics and arrays:
To declare a new generic list and then do operations with it:
ListintsGeneric = new List (); // Add item to list intsGeneric.Add(234); // convert to array int[] intsArray = intsGeneric.ToArray();
Note you can create a generic of any type of object, including your own objects.