abdul gaffar

abdul gaffar

  • NA
  • 17
  • 523

working on Generics with IEnumerable

Dec 8 2016 12:59 AM
Hi all,
can any body tell me what is the error in the bellow code, i am getting the error that, you are not implemented the GetEnumerator in the IEnumerable
 
 
public class Stack<T> : IEnumerable<T>
{
T[] items;
int count=0;
public void Push(T data) { }
public void Pop() { }
public IEnumerator<T> GetEnumerator()
{
for (int i = count - 1; i <= 0; i++)
{
yield return items[i];
}
}
}

Answers (1)