What is GenericCollection?

Posted by Kundan64 under C# on 1/13/2013 | Points: 10 | Views : 1169 | Status : [Member] | Replies : 1
What is GenericCollection in C#, Why we use it?




Responses

Posted by: Kundnani.Rt on: 1/19/2013 [Member] Starter | Points: 25

Up
0
Down
Generic Collections are the Collections which you can make of your own Generic type.

Example: You are making List Collection Generic by adding int type

List<int> list = new List<int>();

list.Add(2);
list.Add(3);
list.Add(5);
list.Add(7);


foreach (var element in list)
{
Console.WriteLine(element);
}


Kundan64, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response