Campbell Ritchie wrote:You seem to have an Iterator not used as a variable local to a loop. That isn't right. You are liable to exceptions like that. Only use Iterators as local loop variables. Use an index for the List and its add(int, E) method to add elements.
Notice also that on line 19, the declared type should be the interface type List, not the implementation type ArrayList.
Christian Klugesherz wrote:
Jus something that I didn't undrstood.
Notice also that on line 19, the declared type should be the interface type List, not the implementation type ArrayList.
What did I wrong ?
Christian Klugesherz wrote:
Here below the code, with no error, but didn't work.
The navigation through the list didn't work
Next index (before next() ) =0
Next index (after next() ) =1
Next index (before next() ) =0
Next index (after next() ) =1
Christian Klugesherz wrote:
OK, Following you approach, (If understood) I remodified the code, but also here it didn't work.
Each time when I click on “next” I get:
Next index (before next() ) =0
Next index (after next() ) =1
Next index (before next() ) =0
Next index (after next() ) =1
The iterator index didn't increase with : "personIterator.next();"
It's a nightmare.
There are three kinds of actuaries: those who can count, and those who can't.
There are three kinds of actuaries: those who can count, and those who can't.
Christian Klugesherz wrote:Sure Piet, there is a test which is missing . Thanks
There are three kinds of actuaries: those who can count, and those who can't.
a display manager instead.
Don't get me started about those stupid light bulbs. |