Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Array class implementation in C# [duplicate]

Tags:

arrays

c#

Going to the implementation details, I see the implementation of Array class as

public abstract class Array : ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Implementation of IList interface reads as

public interface IList : ICollection, IEnumerable

My question is, doesn't the Array class automatically implement ICollection and IEnumerable the moment it implements IList? Why are these implemented explicitly?

like image 941
TheSilverBullet Avatar asked Feb 19 '13 10:02

TheSilverBullet


People also ask

What is array implementation in C?

Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value. To create an array, define the data type (like int ) and specify the name of the array followed by square brackets [].

How is array implemented internally?

Internally an ArrayList uses an Object[] Array which is an array of objects. All operation like deleting, adding, and updating the elements happens in this Object[] array.

What is array in C with example?

An array is a variable that can store multiple values. For example, if you want to store 100 integers, you can create an array for it. int data[100];


1 Answers

The implementation of Array is:

Array : ICloneable, IList, IStructuralComparable, IStructuralEquatable

Take a look on this source in here

Maybe you took a look on MSDN which just make document clearer.

like image 92
cuongle Avatar answered Oct 01 '22 05:10

cuongle