Question: Build true iterators in Java using threads. Make your solution as clean and as general as possible. In particular, you should provide the standard Iterator
Build true iterators in Java using threads. Make your solution as clean and as general as possible. In particular, you should provide the standard Iterator or IE numerable interface, for use with extended for loops, but the programmer should not have to write these. Instead, he or she should write a class with an Iterate method, which should in turn be able to call a Yield method, which you should also provide. Evaluate the cost of your solution. How much more expensive is it than standard Java iterator objects?
Step by Step Solution
3.40 Rating (162 Votes )
There are 3 Steps involved in it
Certainly Below is a clean and generalized implementation of true iterators in Java using threads We will achieve this by providing an Iterable interface and we will have an Iterate method that can yi... View full answer
Get step-by-step solutions from verified subject matter experts
