Iterator Interface

Iterator Interface -
    Iterator Interface is used for retrieve the elements over the collection.
Iterator Interface is similar to Enumeration Interface. Iterator Interface has one method extra for remove the elements from collection.

Iterator Interface has three methods.

boolean hasNext() -

          This method is used for just check the presence of elements within the collection. If collection has elements, it returns true otherwise returns false.

E next() -
    This method is used to retrieve the view of element from the collection.     

void remove() -
    This method is used to delete elements from the collection which lastly return by the iterator.

Comments

Recent Post

Recent Posts Widget

Popular posts from this blog

Capture image from webcam java code, examples

How to capture finger prints in java

Shallow Copy Deep Copy Java example