java4all@1986 java. Powered by Blogger.

Difference between Iterator,ListIterator and Enumeratio?

>> Monday, May 30, 2011

Iterator:It is an interface, which can be used to iterate objects in forward Direction.
     Following are the methods of Iterator,
     1.)public boolean hasNext(){};
      2.)public object next(){};
       3.)public void remove(){};

ListIterator:It is an interface ,which can be used to iterate objects in forward direction as well as in Backward direction.
          Following are the methods of ListIterator,
        1.)public boolean hasNext(){};
      2.)public object next(){};
       3.)public void remove(){};
       4.)public boolean hasPerivous(){};
       5.)public object perivous(){};

Enumeration: It is an interface which can be used to iterate objects in forward direction.But it doesn't havr a method to remove object.
        Following are the methods of Enumeration,
      1.)public boolean hasMoreElement(){};
       2.)public object nextElement(){};

0 comments:

Post a Comment

FaceBook Login

HTML/JAVASCRIPT

HTML/JAVASCRIPT

HTML/JAVASCRIPT

HTML/JAVASCRIPT

Total Pageviews

STATCOUNTER

  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP