I am trying understand the below code .Please help me. While reading blog i got this code.Below is the blog url http://tutorials.jenkov.com/java-generics/wildcards.html.
class A {}
class B extends A {}
class Run {
public static void main(String Ars[]) {
List<A> a = new ArrayList<A>();
List<B> b = new ArrayList<B>();
a = b; // Compile time error
}
}
Please tell me why i am getting compile time error.
Type mismatch: cannot convert from List<B> to List<A>