Well, sure.
public void Add(T item)
{
this.Add(item);
}
Here you have a method that calls itself, which in turn calls itself, which in turn calls itself, until you run out of stack.
You probably want to add a field of type List<T>
, and have your Add
method call _list.Add(item);
. Or write the new item to disk, or store it wherever else you want -- but a list would be the most common place to store it.