public class Abc {
public void process(List<A> a) {
}
public static void main(String[] args) {
Abc a = new Abc();
List<A> alist = new ArrayList<A>();
List<B> blist = new ArrayList<B>();
List<C> clist = new ArrayList<C>();
a.process(clist);
}
}
class A {
}
class B extends A {
}
class C extends B {
}
Why compilation issue with this code ? As per Object Oriented programming, there should not be any issue with this