Question: Write a group of generic static methods for examining and manipulating a collection of items via the collections iterator. For example, one of the methods
Write a group of generic static methods for examining and manipulating a collection of items via the collection’s iterator. For example, one of the methods might have this heading:

When the find method is activated, the iterator, it, is already in some collection. The method searches the collection via the iterator. If one of the collection’s elements is equal to the target (using the equals method), then a reference to that element is returned; if the target is never found in the range, then the null reference is returned (and the iterator is left at a position that is just after the target).
Discuss and design other methods for your toolkit that manipulate a collection. As a starting point, please use the linked-list methods from the previous chapter.
public static E find( Iterator it, E target );
Step by Step Solution
3.35 Rating (155 Votes )
There are 3 Steps involved in it
The Java Generics programming is introduced in J2SE 5 to deal with typesafe objects It makes the cod... View full answer
Get step-by-step solutions from verified subject matter experts
