I'll explain the question with an example.
The C# predefined interface IList<T>
inherits ICollection<T>
, IEnumerable<T>
& IEnumerable
.
The C# predeined interface ICollection<T>
inherits IEnumerable<T>
& IEnumerable
.
Given the above statements, my question is, why are the interfaces IEnumerable<T>
& IEnumerable
being explicitly inherited in IList<T>
becuase they are already being inherited in ICollection<T>
.
In essence, wouldn't the below suffice?
public interface
IList<T>
: ICollection<T>
{ //code }
public interface ICollection<T>
: IEnumerable<T>
, IEnumerable { //code }
I want to know why have the interfaces been inherited explicitly while they were inherited as a part of other interface.