0
what are generics classes and methods and ehat is collection api in java??
is collection api and generics are same in java?? help required
3 Answers
+ 2
Collection API was introduced to handle data structures in an easy way and made things pretty simple so that you can focus more on the actual logic behind the code and not on how to store it.
On the other hand generics are something similar to templates in C++ which helps in code reusability and reduces redundancy.
List, Set, Map are all generic because you can declare the type of data which you want to store.
0
Avinesh right bro...but can you plz explain generics with help of code?