Compiler doesn't assume. It is instructed so. I have one question here why do you want a list which could be of String and its children. Because String is final. i.e. It can't be extended and redefined. You can use it directly as List of String. Though it is not harmful or wrong, it does do byte code injection at time of compilation which is a overhead. If you are using this in real time application you shall better remove it.