Difference between iterator and list iterator?


Iterator
  • Using iterator you can visit the elements of collection in the forward direction only 
  •  Using iterator you cannot add elements to collection 
  •   Using iterator you can not replace existing object with new object. 
  •   Using iterator you can not get index of elements
List Iterator
  • In list iterator you can visit the elements of collection in the forward and backward direction. 
  •   Using list Iterator you can add elements to collection. 
  •   Using iterator you can  replace existing object with new object. 
  •   Using list Iterator you get index of  elements  list

1 comment :

  1. Can you provide some examples here.

    ReplyDelete