Click here to Skip to main content
16,014,734 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
public interface CarIterator
{
      public Iterator createIterator();

}


I've got the above code for creating an iterator interface but i get the following error.
SQL
C:\Documents and Settings\20818781\Desktop\Pattern_iterator\CarIterator.java:3: cannot find symbol
symbol  : class Iterator
location: interface CarIterator
      public Iterator createIterator();
             ^
1 error

Process completed.
Posted

1 solution

Have you imported the Iterator class into your interface? (package java.util):
import java.util.Iterator;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900