What is Ienumerable
Answer / wasim akhtar
The IEnumerable interface appears throughout C# programs. It specifies that the underlying type implements the GetEnumerator method. It enables the foreach-loop to be used.
Program that uses IEnumerable<T> [C#]
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main()
{
IEnumerable<int> result = from value in Enumerable.Range(0, 2)
select value;
// Loop.
foreach (int value in result)
{
Console.WriteLine(value);
}
// We can use extension methods on IEnumerable<int>
double average = result.Average();
// Extension methods can convert IEnumerable<int>
List<int> list = result.ToList();
int[] array = result.ToArray();
}
}
Output
0
1
| Is This Answer Correct ? | 0 Yes | 0 No |
11. diff b/w Dll and Exe
What is one way operation?
What is the use of delegates
2. I've a class Parent Class A and a Derived Class B. Here is a scenario. I've an instance of Class A as objA and an instance of Class B as objB. I can refer a child class variable as objB=objA, but cannot do objA=objB what is the reason?
What is the purpose of cache? : Dot net architecture
What are the options provived by vss to the user? how it will help us while delevoping application?
What are the new features of .net 2.0?
What is Ienumerable
how to set the startup position of the form?
Define a virtual memory? : Dot net architecture
what is the shortcutkey for solution explorer and add new item?
what are the things we generally declare in session_start , application_start ?