Download Mystery of Yield keyword Code APK latest version Free for Android
Version | 1.09 |
Update | 7 years ago |
Size | 25.58 MB (26,818,011 bytes) |
Developer | Learn and Master Now |
Category | Apps, Education |
Package Name | com.leman.yieldstatement |
OS | 2.3 and up |
Mystery of Yield keyword Code APPLICATION description
The yield keyword is used with methods that return IEnumerable or IEnumerator and it makes the compiler generate a class that implements the necessary plumbing for using the iterator.
The yield keyword effectively creates a lazy enumeration over collection items that can be much more efficient. For example, if your for each loop iterates over just the first 5 items of 1 million
items then that's all yield returns, and you didn't build up a collection of 1 million items internally first. Likewise you will want to use yield with IEnumerable return values in your own
programming scenarios to achieve the same efficiency.
It is often more convenient to use the yield statement. The yield statement is a special kind of return, that ensures that the function will continue from the line after the yield statement next time it is called.
The easiest way understand code like this is to use the app and see what happens.