Results 1 to 2 of 2
  1. #1
    JeanNoel 53 is offline Member
    Join Date
    Dec 2010
    Posts
    5
    Rep Power
    0

    Smile Some problems with java

    Hello
    I have did lot of C++ before starting java
    and i am converting a c++ program to java
    the program use lot of list operations
    the first problem i have is no it-- is available
    in a list you can need to backtrack the Iterator
    I only found next() as operation on an Iterator
    does'it exist a previous() function
    if no is it possible to add it?
    have you any experience in this topic?

  2. #2
    user0 is offline Senior Member
    Join Date
    Dec 2010
    Posts
    100
    Rep Power
    0

    Default

    Generally speaking, the Iterator<E> class does not support backward iteration. However, since you are using lists, try experimenting with ListIterator<E> instead. This has a hasPrevious() and previous() method. A ListIterator<E> extends Interator<E> but also enables you to traverse the list in either direction.

    Hope that helps!
    --user0--

Similar Threads

  1. Please help me solve these Java Problems
    By saculellav in forum New To Java
    Replies: 9
    Last Post: 07-06-2014, 09:25 AM
  2. java problems
    By p595285902 in forum New To Java
    Replies: 6
    Last Post: 11-28-2010, 10:55 PM
  3. Weird java problems
    By debylni in forum Advanced Java
    Replies: 5
    Last Post: 03-10-2010, 02:17 PM
  4. Replies: 2
    Last Post: 01-16-2010, 04:50 PM
  5. Java Problems
    By xonkie in forum New To Java
    Replies: 6
    Last Post: 12-03-2008, 07:14 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •