サンプル
public static class
ClassA
implements
Iterator {
//その他の Iterator メソッド...
public
Object next () {
try
{
//...
}
catch
( Exception e ) {
// Handle exceptions here
}
}
}
解決策
catch 節の機能を見直します。 java.util.NoSuchElementException がエラーにスローされていることを確認してください。
public static class
ClassA
implements
Iterator {
//その他の Iterator メソッド...
public
Object next() {
try
{
//...
}
catch
( Exception e ) {
throw new NoSuchElementException();
}
}
return nextObj;
}