What is the difference between IEnumerator and IEnumerable?

.net, c#, ienumerable, ienumerator

Solution

IEnumerable is an interface that defines one method GetEnumerator which returns an IEnumerator interface, this in turn allows readonly access to a collection. A collection that implements IEnumerable can be used with a foreach statement.

Definition

IEnumerable 

public IEnumerator GetEnumerator();

IEnumerator

public object Current;
public void Reset();
public bool MoveNext();

Problem

Possible Duplicate: Can anyone explain IEnumerable and IEnumerator to me? What are the differences between IEnumerator and IEnumerable?

Original source

Related problems