问道G 的题# JobHunting - 待字闺中
h*g
1 楼
A. Given
interface Iterator {
T next();
boolean hasNext();
}
interface Predicate {
boolean accept(T t);
}
Implement a method that creates an "accept" iterator that returns items
accepted by the passedin pred variable.
Iterator conditionIterator(Iterator input, Predicate pred) {
}
这题撒意思?需要设计模式的背景知识吗?
interface Iterator
T next();
boolean hasNext();
}
interface Predicate
boolean accept(T t);
}
Implement a method that creates an "accept" iterator that returns items
accepted by the passedin pred variable.
Iterator
}
这题撒意思?需要设计模式的背景知识吗?