Код: Выделить всё
public interface ThrowingIterator {
// matches interface of standard Iterator, but next() and hasNext() can throw E
}
Код: Выделить всё
public class CustomIterator implements ThrowingIterator {
// ...
public CustomIterator() {
// ...
}
public static ThrowingIterator helperFactory() {
// ...
}
}
Код: Выделить всё
ThrowingIterator
Подробнее здесь: [url]https://stackoverflow.com/questions/78704406/error-on-generic-type-within-wildcard-bound[/url]