C#:
public class List : IEnumerable
{
private object[] _objects;
public List()
{
_objects = new object[100];
}
public void Add(object obj)
{
_objects[_objects.Count] = obj;
}
public IEnumerator GetEnumerator()
{
return new ListEnumerator(); //why is there a new keyword here?
}
private class ListEnumerator : IEnumerator
{
}
}
In the code above, why is there a "return new"?
I have only seen "return".
What's the difference between "return" and "return new"?