Results 1 to 2 of 2
Thread: Some problems with java
- 12-30-2010, 10:08 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 5
- Rep Power
- 0
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?
- 12-30-2010, 11:24 PM #2
Senior Member
- Join Date
- Dec 2010
- Posts
- 100
- Rep Power
- 0
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
-
java problems
By p595285902 in forum New To JavaReplies: 6Last Post: 11-28-2010, 10:55 PM -
Weird java problems
By debylni in forum Advanced JavaReplies: 5Last Post: 03-10-2010, 02:17 PM -
Problems with Java 2D example in the book: JAVA 2D Graphics by O'Reilly
By Lil_Aziz1 in forum Java 2DReplies: 2Last Post: 01-16-2010, 04:50 PM -
Java Problems
By xonkie in forum New To JavaReplies: 6Last Post: 12-03-2008, 07:14 PM -
Please help me solve these Java Problems
By saculellav in forum New To JavaReplies: 7Last Post: 07-27-2008, 11:58 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks