A Presentation on Collections
What are Collections Collections are the group of similar and dissimilar objects.Thorugh collections we can implement diff...
Need of Collections 1.Gives Non Persistent Data Structure. 2.It provides specialized classes for data storage and retrieva...
<ul><li>Types of Collections:- </li></ul><ul><li>Non Generic Collections   </li></ul><ul><li>System.Collections </li></ul>...
Non Generic  Collections <ul><li>These Collections contains interfaces and classes that define various collections of obje...
Categories of Non Generic  Collections <ul><li>Ordered collections:  The Stack and Queue classes are both examples of Orde...
Generic Collections It allow users to create collections that provide better type safety and performance than non-generic ...
 
Generic vs. Non Generic Collections Non-Generic   Similar Generic Type  ArrayList   List<T>  Hashtable   Dictionary<TKey,T...
 
Conclusion Collections are a vital element of any object-oriented architecture. Offering the capability to group objects i...
Upcoming SlideShare
Loading in …5
×

Collections

937 views

Published on

Collections

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
937
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
70
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Collections

  1. 1. A Presentation on Collections
  2. 2. What are Collections Collections are the group of similar and dissimilar objects.Thorugh collections we can implement different various structures. Collections implement various classes as well Collections provide a way to store arbitrary objects in a structured fashion, and we all know how useful they are in everyday programming.
  3. 3. Need of Collections 1.Gives Non Persistent Data Structure. 2.It provides specialized classes for data storage and retrieval. 3. The interfaces may be inherited to create new collection classes. 4. Well tested and efficient methods are provided so user does not have to spent time in constructing methods.
  4. 4. <ul><li>Types of Collections:- </li></ul><ul><li>Non Generic Collections </li></ul><ul><li>System.Collections </li></ul><ul><li>Generic Collections </li></ul><ul><li>System.Collections.Generic </li></ul>Note:
  5. 5. Non Generic Collections <ul><li>These Collections contains interfaces and classes that define various collections of objects, such as lists, queues, bit arrays, hash tables and dictionaries </li></ul><ul><li>Non Generic Collections are not type safe the data we supply is converted to object. </li></ul><ul><li>It implements one or more of the ICollection,IDictionary,IEnumerable,IComparable and IList interfaces. </li></ul>
  6. 6. Categories of Non Generic Collections <ul><li>Ordered collections: The Stack and Queue classes are both examples of Ordered collections implementing ICollection Interface. </li></ul><ul><li>Indexed collections: Array List class is one example of an indexed collection implementing IList Interface. </li></ul><ul><li>Keyed collections: The Hash Table class is one example of an Indexed Collection that implements the IDictionary interface. </li></ul>
  7. 7. Generic Collections It allow users to create collections that provide better type safety and performance than non-generic strongly typed collections .Applications that target version 2.0 and later of the .NET Framework should use the generic collection classes Example :- instead of using the Hashtable class, which allows keys and values to be of any type, you can use the Dictionary generic class and specify the type allowed for the key and the type allowed for the value.
  8. 9. Generic vs. Non Generic Collections Non-Generic  Similar Generic Type ArrayList  List<T> Hashtable  Dictionary<TKey,TValue> SortedList SortedList<TKey,TValue> Queue Queue<T> Stack Stack<T> N/A  SortedDictionary<TKey,TValue> N/A KeyedCollection<TKey,TItem> N/A LinkedList<T>
  9. 11. Conclusion Collections are a vital element of any object-oriented architecture. Offering the capability to group objects in logical constructs, they improve code readability and self documentation, as well as enhance maintainability. As we see that collections reduces the Programming effort and increases program speed and Quality so it is always a good practice to use collections.

×