I have a basic question regarding assignment of a list of subclass to a list of superclass.
So I have something like the following:
Class B extends
Because List does not extend List. For example, Integer extends Number and so does Long. So List can contain both Integer and Long. So if you assign List to List you will be able to add Long to your list of integers.
You can declare
List super B> superB;
And that would allow assignment to superB of any list that contains B and its super classes.
But it's not the same as in your case aList=bList.
or
List extends A> extendsA;
Examples
List super Integer> superA;
superA = new ArrayList();
List extends Number> extendsNumber;
extendsNumber = new ArrayList();