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.

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!