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(){};
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