Generics allow particular(Unique but similar) types of object to save in Collections. If wrong type of object added in Collections the program will fail at compile time. Generics provides Type Safety, No Types Cast Required.
Earlier Example of Collection
Vector vc=new Vector();
vc.add("Pakistan");
String s=(String)vc.get(0); -- "Required Type Cast"
Generics Example
Vector<String> vc=new Vector<String>();
vc.add("Pakistan");
vc.add("England");
String country=vc.get(0); -- "No Type Cast"
List<String> list=new ArrayList<String>();
list.add("Pakistan");
list.add("England");
String country=list.get(0); -- "No Type Cast"