I have the following interfaces:
public interface Successorable<E> extends Comparable<E>
E suc();
}
and
interface IInterval <E extends Successorable<E>> {
E min();
E max();
}
I'm trying to implement IInterval by doing:
public class Interval<E> implements IInterval<E> {
....
However eclipse complains that the type E is not a valid substitute for the bounded parameter <E extends Successorable<E>>
of the type IInterval<E>
.
What am I doing wrong?
Thanks!
Best Answer
I believe you need to restate your conditions. The plain old
E
inInterval<E>
doesn't necessarily fulfillE extends Successorable<E>
so you need to be more specific about your parameter.