I really don't understand your question. The Vector class implements the Iterable interface. Is that what you mean?
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Joined: Aug 22, 2010
Wouter Oet wrote: The Vector class implements the Iterable interface. Is that what you mean?
Yes ,Vector class must have implemented Iterator interface ...right ,why should it must implement Iterable...I can't understand the hierarchy is bit confusing. And On the following code i used iterator() Method where it is defined
Many Collection classes have a private inner class that implements Iterator. An instance of this class is returned. But you don't need to know what the actual class is. All you need to know is that it implements Iterator, and therefore has working hasNext() and next() methods, and possibly also a working remove() method (I said possibly since it's allowed to throw a UnsupportedOperationException from it).