Question: Suppose we have a class called someCollection, that returns an iterator. What code would you need to add to this class to ensure it provides
Suppose we have a class called someCollection, that returns an iterator. What code would you need to add to this class to ensure it provides an iterator? Why is that code needed to create an iterator (what does that code do?)? You don't need to write any code, you just need to describe what code must be added. Make sure you include a description of all the necessary code. Hint: think carefully about the exercise you did on iterators, and all the code that went into making that class. If you copy/paste the code from the exercise you will get a mark of 0. You need to provide a description of the code that needs to be added (very short segments of Java syntax would be ok). Suppose we have a class called someCollection, that returns an iterator. What code would you need to add to this class to ensure it provides an iterator? Why is that code needed to create an iterator (what does that code do?)? You don't need to write any code, you just need to describe what code must be added. Make sure you include a description of all the necessary code. Hint: think carefully about the exercise you did on iterators, and all the code that went into making that class. If you copy/paste the code from the exercise you will get a mark of 0. You need to provide a description of the code that needs to be added (very short segments of Java syntax would be ok)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
