[Solved] What is generics, its uses and application? [duplicate]
Generics is used to create “Type safe” collections like List, Map etc. It means that we can add only known/expected types to collections in order to avoid storing different data in one collection. For e.g //without generics ArrayList list = new ArrayList(); list.add(new Object()); list.add(new Interger()); list.add(new String()); //with generics ArrayList<String> list = new ArrayList<String>(); … Read more