Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following interfaces:

public interface Successorable<E> extends Comparable<E> 
    E suc();


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?


share|improve this question
up vote 4 down vote accepted

I believe you need to restate your conditions. The plain old E in Interval<E> doesn't necessarily fulfill E extends Successorable<E> so you need to be more specific about your parameter.

public class Interval<E extends Successorable<E>> implements IInterval<E> {
    public E min() {
        throw new UnsupportedOperationException();

    public E max() {
        throw new UnsupportedOperationException();
share|improve this answer
What do you mean by more specific? I tried to replace E with 'E extends Successorable<E>' but it doesn't work. I'm a newbie at this... – dasen Mar 22 '12 at 19:03
I've tested the answer that I gave and it compiles handily. Have you tried it just as I posted? – Kyle Mar 22 '12 at 19:11
I'll add, don't always trust the eclipse compiler, double check that javac is producing the same answer from the CL – Martijn Verburg Mar 22 '12 at 19:25
I commented before you showed the code example, yes it works, thanks! – dasen Mar 24 '12 at 15:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.