Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote