In this article I am going to give a brief introduction about Array and Collection.
Array Array is a group of similar data type which is fixed in size. Under array there is no process of boxing and unboxing because Array is Strongly typed. Example:
Collection Collection is a group of homogenous and heterogeneous data type. Size of Array is not fixed and also Collection is not strong type. We use Generic to make Collection as Strong type. In C# we use namespace System.Collection.Generic to implement Generic on Collection. Syntax of Collection Collection<data type>Name =new <data type>(); Generally we use Collection when there is Heterogeneous data type object. Suppose there is one School and the principal of the school would like to know Student Id, Student Name and Course Name of student of Branch CSE, so it is better to use Collection because we have to display the data of Heterogeneous data type object. Like,
Note: The difference between Array and Collection/Array and Array list /Array and Data list will be the same.
Working with Directories in C#