摘要:
1.Motivation for generics 动机The following block of Java code illustrates a problem that exists when not using generics. First, it declares anArrayListof typeObject. Then, it adds aStringto theArrayList. Finally, it attempts to retrieve the addedStringand cast it to anInteger. List v = new ArrayList. 阅读全文