Please explain about IEnumerable in easy way and why we need?
List Yrs = new List();
Yrs.Add(1992);
Yrs.Add(1993);
Yrs.Add(1994);
Yrs.Add(1996);
Yrs.Add(1997);
Yrs.Add(1998);
// IEnumerable ienum = (IEnumerable)Yrs;
foreach (int i in Yrs)
{
Console.WriteLine(i);
}
With out IEnumerable also foreach loop works what is the need?
Jayanth ReddyPosted Sep 18, 2019, 3:14 AM
Amit KumarPosted Sep 16, 2019, 11:43 PM
Amit MohantyPosted Sep 16, 2019, 4:49 AM