Tuesday, June 12, 2012

Best Practices: Generic lists

ArrayList and Collection class can store Object data.

As Objects are base class for all types, you can store any kind of data within ArrayList and Collections. But mostly we will store specific type of data within collections. So we probably will use casting while retrieving data, which will impact the performance. To avoid this, we can use Generic class such as List<T> and Dictionary<K,V>

No comments:

Post a Comment