Hi, I wrote this code:
public class C1 implements Iterable<NC1> {
private LinkedList<NC1> list;
public static class NC1 {
...
}
...
x public Iterator<NC1> iterator() {
return list.iterator();
}
}
but eclipse whines (at the x-ed line):
- The return type is incompatible with Iterable<NC1>.iterator()
- implements java.lang.Iterable<NC1>.iterator
I don't understand where the mistake is. Can someone help?