Java provides support to the Generic features of JV. For specification of the concrete types to certain general methods or classes, Generics is used.
Above given definition is an abstract definition. For better understanding, consider few examples.
Object instances are stored by the help of List interface. Therefore one can do storage and also place objects in a List. E.g. Java Code: List list = new ArrayList();
List list = new ArrayList();
In this post, I will write about how Java generics help us in using legacy code.
Generics are new in Java and now developers understand the importance of it and it is being used as required. Question arises, what about the legacy code? Consider an IT firm that is working on an application for 5 years, and they used Java 1.4 for development. They the plan to use 1.5 for development simply because it is better than 1.4. Are they supposed to convert the old code to 1.5 also? This is