Interviews2 answers
What is differnce between Array,Collection and List. ?
2 Answers
List are generics and constructed types and size manage is done automatically so ideal for linear collections.
ex.
List myIntegerList = new List ();
myIntegerList.Add(1);
myIntegerList.Add(2);
Array do not resize dynamically and a set of sequential memory locations. Refer Arrays in C#
Munesh SharmaPosted May 30, 2016, 9:17 PM EDT
Array:Array is group of homogeneous data type object.The size of Array is fixed and array is strong data type.
int[]A=new int[6]{1,2,3,4,5,6}
Collection: Collection is group of heterogeneous data type object.The size of collection is not fixed and it contains the generic data type.
Collection=new Collection{Ram,Shyam}
List:List is Group of data type object
list=new list
where t is data type
Sandeep KumarPosted Sep 7, 2015, 9:10 AM EDT

