I have a strange problem with inheritance and I don't understand why it should not work:
public interface A { }
public interface B extends A {}
public class C {
void test() {
ArrayList<A> foo = new ArrayList<B>();
}
}
But compiling gives me the following error
Type mismatch: cannot convert from ArrayList<B> to ArrayList<A> C.java /bla/src/de/plai/test line 8 Java Problem