• Post Reply Bookmark Topic Watch Topic
  • New Topic

listiterator?  RSS feed

 
bairava surya
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

code doesnt work helpme?
 
Stefan Evans
Bartender
Posts: 1837
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is not working about it?
It compiles, it runs.
What output are you expecting?

Calling the listIterator() method gives you an iterator pointing at the head/start of a list.
What comes before the start of a list?
 
bairava surya
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
am not getting the backward traversal as output?
 
Stefan Evans
Bartender
Posts: 1837
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well if you want a backward iteration, you will have to START at the other end of the list.
There is an overloaded version of listIterator() method that should help you do that. See java.util.List interface
 
bairava surya
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how i can modify the above program to print in reverse order?
 
Sekhar Nat
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Quoting the docs:

ListIterator<E> listIterator()
Returns a list iterator over the elements in this list (in proper sequence).
ListIterator<E> listIterator(int index)
Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.
 
bairava surya
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is fill ratio in java i had come cross in concept of hashmap?
 
Stephan van Hulst
Saloon Keeper
Posts: 7992
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bairava, please take the time to read the tutorials and the JavaDocs. A lot of these questions can then be answered with a quick Google search.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!