java iterator/iterable subinterface
问题 I have an interface for a variety of classes, all of which should implement Iterator, so I have something like public interface A extends Iterable<A> { ...otherMethods()... } For the concrete classes, however, this means I must use public class B implements A { public Iterator<A> iterator() {...} } when I'd prefer (or at least, think I'd prefer) to use public Iterator<B> iterator() {...} so that concrete use of the class could have the explicit type (in case I wanted methods that weren't in