标签:
Provides compile-time type safety for collections and eliminates the pain of casting. Generics creates strongly typed classes to do generic operation.
1 Vector v = new Vector(); 2 v.add("hello"); 3 v.add(new Integer(1)); 4 v.add(new HashTable()); 5 6 String s = (String)v.get(0);
标签:
原文地址:http://www.cnblogs.com/touchdown/p/5199685.html