Question: Use threads to build support for true iterators in Java. Try to hide as much of the implementation as possible behind a reasonable interface. In
Use threads to build support for true iterators in Java. Try to hide as much of the implementation as possible behind a reasonable interface. In particular, hide any uses of new thread, thread.start, thread.join, wait, and notify inside implementations of routines named yield (to be called by an iterator) and in the standard Java Iterator interface routines (to be called in the body of a loop). Compare the performance of your iterators to that of the built-in iterator objects (it probably won’t be good). Discuss any weaknesses you encounter in the abstraction facilities of the language.
Step by Step Solution
3.38 Rating (164 Votes )
There are 3 Steps involved in it
To build support for true iterators in Java using threads you could use the Thread class to create and start new threads and the Threadjoin method to ... View full answer
Get step-by-step solutions from verified subject matter experts
