Has anyone idea about this code, where is the problem
import java.util.Iterator;
import java.util.NoSuchElementException;
public class AlbumIterator implements Iterator<Fotoablum>{
Fotoalbum album;
Foto aktuell;
public AlbumIterator(Fotoalbum album){
this.album=album;
this.aktuell=aktuell;
}
public boolean hasNext(){
if(this.aktuell == null){
return true;
}else{
return this.aktuell.getNächstes() != null;
}
}
public Foto next(){
if(this.aktuell == null){
this.aktuell = this.ablum.erstesFoto;
return this.aktuell;
}
if(this.aktuell.getNächstes() == null){
throw new NoSuchElementException("Keine weiteren Elemente vorhanden");
}else{
this.aktuell = this.aktuell.getNächstes();
return this.aktuell;
}
}
public void remove() {
throw new UnsupportedOperationException("Diese Aktion wird nicht unterstützt.");
}
public static void main(String[] args){
return;
}
}
Error message
AlbumIterator.java:5: error: cannot find symbol
public class AlbumIterator implements Iterator<Fotoablum>{
^
symbol: class Fotoablum
AlbumIterator.java:22: error: cannot find symbol
this.aktuell = this.ablum.erstesFoto;
^
symbol: variable ablum
this is a homework about java iterator. I tried so many times, but it is still wrong, how can I make it works, do I need a main function?