Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Based on <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Enumeration.html" rel="nofollow">this</a>, <em>Enumeration</em> is kind of deprecated and the new <em>Iterator</em> interface should be used in Java. In C#, on the other hand, an interface called <em>IEnumerator</em> was in use since the first version. Later, generic <em>IEnumerator&lt;T&gt;</em> was introduced. All of these interfaces' role is to implement the <a href="http://en.wikipedia.org/wiki/Iterator_pattern" rel="nofollow">Iterator pattern</a>.</p> <p>In contrast to the Java version, C# does not have separate <em>hasMoreElements()</em> and <em>nextElement()</em> methods. Both of them are unified into the <em>MoveNext()</em> method which returns <em>true</em> on successful iteration step and <em>false</em> once there are no more elements to iterate on. Since version 2.0 of the C# language there is the <a href="http://msdn.microsoft.com/en-us/library/vstudio/9k7k7cf0.aspx" rel="nofollow">yield</a> keyword, which instructs compiler to generate a proper implementation of the interface and is very usable for the simple cases.</p> <p><em>IEnumerator</em> is usually being used in conjunction with the <a href="http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx" rel="nofollow">IEnumerable</a> interface and the <a href="http://msdn.microsoft.com/en-us/library/ttw7t8t6.aspx" rel="nofollow">foreach</a> keyword.</p> <p>You can read more <a href="http://msdn.microsoft.com/en-us/library/dscyy5s0.aspx" rel="nofollow">here</a>, <a href="http://msdn.microsoft.com/en-us/library/system.collections.ienumerator.aspx" rel="nofollow">here</a> and <a href="http://msdn.microsoft.com/en-us/library/78dfe2yb.aspx" rel="nofollow">here</a>.</p> <p><strong>Update</strong> OK, the answer by StriplingWarrior ends the discussion.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload