Answer Posted / banaja
public class ExampleIterator : IEnumerable {
public IEnumerator GetEnumerator() {
yield return 1;
}
}
The class ExampleIterator implements the IEnumerable
interface, which requires the GetEnumerator method to be
implemented. The GetEnumerator method returns an
IEnumerator instance. In the implementation of
GetEnumerator, the value 1 is returned rather than an
IEnumerator interface instance. This is odd, because how
can a value type be returned when a reference type is
expected? The magic is the yield keyword, which provides
the missing code in the form of generated IL.
The yield keyword is a compiler directive that generates a
very large chunk of IL code. Using ILDASM.exe it is
possible to reverse engineer what the compiler generated
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is il and c#?
What is the difference between response.redirect & server.transfer?
Explain me what is .net web service?
What are the features of dot net?
What is the use com component in .net?
Tell me about secure socket layer? How to make use of the technology?
Tell us what do the following acronyms in .net stand for: il, cil, msil, cli and jit?
What are the new thee features of com+ services, which are not there in com (mts)?
What is the best way to crack the certification?
i had attended to infosys interview on 17th april 2010...on .net..3+ experience for Technology Analyst .. to my knowledge i did well in technical and hr whether i loose the interview or still processing is taking place..am confused please. what accuatly would be happend?
A developer company sends dlls to the client. Some client is not happy current functionality, so request some modification. Developer made some changes and send new dll to all clients. Some client is happy with old version, tell me minimal change to so that neither clients get affected?
What tools can I use to develop .net applications?
What is namespaces in .net?
What is view state in .net?
Explain what is the difference between constants and read-only variables?