IEnumerable

suggest change

Introduction

IEnumerable is the base interface for non-generic collections that can be enumerated, such as ArrayList. IEnumerable<T> is the generic counterpart, implemented by List<T> and similar collections. IEnumerator and IEnumerator<T> are the enumerators those collections return, not the collections themselves.

IEnumerable declares GetEnumerator. That method returns an IEnumerator, which foreach uses to walk the collection.

Remarks

Generic collections use IEnumerable<T>. Their GetEnumerator method returns an IEnumerator<T>.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents