Thursday, February 16, 2012

How to create your own generic list?

How to create your own generic list?

1.       Declare class with type parameter T (Eg: SatyamList<T> )
2.       Implement IList<T>, ICollection<T>, IEnumerable<T> interfaces in the class
3.       Create a private ArrayList object within class for storing the custom list values
4.       Write the implementations for the interfaces (in step2)








No comments: