• Post Reply Bookmark Topic Watch Topic
  • New Topic

ListIterator interface not being recognized in my eclipse mars version  RSS feed

 
bhavana chadaga
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi,
  I have been using eclipse Version: Mars.2 Release (4.5.2). with JDK 1.7
  I was writing the following program in collections using ListIterator, but it seems like eclipse doesnt recognize it.
  I have imported all the libraries needed for it, still the problem persists. It would be great if anyone could help me sort it out.
  Thanks.

 
Dave Tolls
Ranch Foreman
Posts: 3068
37
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've called your class ListIterator, and the compiler thinks that's the class you are referring to.
 
Campbell Ritchie
Marshal
Posts: 56587
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Don't put error messages inside code tags; convert them to /* comments */. Don't write so many empty lines, because they make the code harder to read. I have corrected both things in your post, and you can now compile the code (when you rename the class ListIteratorDemo or similar).
Don't declare local variables before you need them, and don't initialise things to null.Don't mix single imports and * imports.
 
Campbell Ritchie
Marshal
Posts: 56587
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hasPrevious and previous are methods and need () in the code.
 
bhavana chadaga
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Dave Tolls I changed the class name, still the problem persists.

it seems the IDE doesnt recognize the ListIterator.
 
bhavana chadaga
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Campbell Ritchie thank you...I'l keep that in mind
 
Dave Tolls
Ranch Foreman
Posts: 3068
37
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to post the new code then.
Also how are you compiling this?
If it's by hand then did you remove the existing ListIterator.class file that had been created?

If in an IDE did you do a clean build?
 
bhavana chadaga
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Dave Tolls, thank you, i had not removed the old file..hence it was not recognizing the interface..
and i am using an IDE.
 
Campbell Ritchie
Marshal
Posts: 56587
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a pleasure
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!