QUESTION 9 Consider an implementation of a List which supported the iterable int
ID: 3906565 • Letter: Q
Question
QUESTION 9 Consider an implementation of a List which supported the iterable interface. Call it MyList. Inside of MyList, a private variable called modCount is maintained to make sure the iterator can throw an exception if the collection changes. When adding an element modCount is increased, and one is removed, modCount is decreased. This is a correct use of modCount? O Yes-as the nodes in list change, modCount changes O Yes the iterator will support fast fail with modCount. O No-modCount must only exist in the iterator object. not the List O No-the modCount variable is not maintained properly.Explanation / Answer
Answer: No (modCount must only exist in Iterator object, not the list)
The Failfast behavior is related to Iteration and not list itself.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.