Why do i get a compilation error on eclipse with the following definition in an interface:
Area is an interface.
public interface Shape {
...
public Comparator<T extends Area> getComparator();
}
and not if I use instead:
public interface Shape {
...
public Comparator<? extends Area> getComparator();
}
Because the compiler has no idea what
Tis supposed to be or represent. Now, if you had something likepublic interface Shape<T>as the interface declaration, we could probably get something to work with that.