Here LinkedList is the base type and <String> is parameterized type. You can apply the quoted line with the following line:
List<String> list2 new LinkedList<String>(); Here List and LinkedList are base types so no problem. Polymorphism (parent class/interface type ref variable holding object of subtype/implementing class type object) applies to base type;
You can't write like: List<Object> list3 = new LinkedList<String>(); //Line #1
under the impression that String IS-A(n) Object. That would be wrong. Actually these type informations are erased finally. They are only to restrict the programmers so that nothing wrong can be inserted to the List.
After type erasure the Line #1 would become List list3 = new LinkedList(); [ April 29, 2007: Message edited by: Chandra Bhatt ]