What is true about C#’s IEnumerator and IEnumerable. Circle best answer. A) The
ID: 3826250 • Letter: W
Question
What is true about C#’s IEnumerator and IEnumerable. Circle best answer.
A) The List class implements both IEnumerator and IEnumerable.
B) The List class implements IEnumerator.
C) The List class implements IEnumerable.
D) These are both interfaces that are needed to implement an iterator.
E) begin() and end() are required methods for IEnumerable.
Pick the two, ordered, terms that best fill in the two spaces in the following passage:
With respect to C#, the List class implements ____________. Another class, that cooperates with List, is defined
that implements ____________.
A) IEnum and IEnumDevice
B) IEnum and IIterator
C) begin() and end()
D) IEnumerator and IEnumerable
E) IEnumerable and IEnumerator
Explanation / Answer
Ans .D
Both are implementation of the iterator pattern
.list class implements IEnumerable interface.
In c# all collections are enumerable .collections include lists,dictionaries, stacks, queues.
When a class implements IEnumerable ,it can be enumerated.
AnsE.
List class implements IEnumerable interface ans another class that cooperates with List can implement the IEnumerator
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.