It seems like we can create and use Enumerators and Iterators "on the fly" without specifically listing those interfaces in an "implements" clause, but we do have to specifically list things like Serializable in an "implements" clause. What is the difference in the use of interfaces that sometimes requires their specific listing in an "implements" clause? Thanks in advance for any insights.
my 2� This is a good example of is-a and has-a relationships. If your class 'is-a' Iterator, you need to implement Iterator and provide definitions for the interface's methods If your class 'has-a' Iterator, you need to import the java.util package (or java.util.Iterator itself) to use the instance of the Iterator hth
Time is the best teacher, but unfortunately, it kills all of its students - Robin Williams. tiny ad: