Explain the similarities and differences between arrays and collections?

 Posted by Tripati_tutu on 10/11/2010 | Category: .NET Framework Interview questions | Views: 5261 | Points: 40

• The Array class is not part of the System.Collections namespace. But an array is a collection, as it is based on the list interface.

• Array has a fixed capacity but the classes in the System.Collections namespace don’t have fixed capacity. That’s why array is a static container, but collection is dynamic container.

• Collections objects have a key associated with them. You can directly access an item in the collection by the key. But to find a specific item in an array, unless you don’t know the index number you need to traverse the array to find the value.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response