Can someone please explain to me why this would cause a runtime exception? It seems to me like I'm accessing an arraylist of the type variable B exclusively.
class A {}
class B extends A {}
List<B> bL = new ArrayList<B>();
List<A> aL = bL;
aL.add(new A());
B b = bL.get(0); // runtime exception