Java Generics

Recent Articles

In this tutorial let us discuss about different aspects of type cast with respect to Java generics. Generics was initially idealized for collections framework. In collections there were lots of cast done. In a way, one of the main objective of Java generics is to help programmer reduce explicit type cast and provide type-safety. Before […]

This Java generics tutorial is to introduce basic terminologies related to generics. They are demonstrated with example code and this tutorial is for beginners only. Java Generics Example Before we go into detail let us see an example for generics in Java. This is to recall and continue from our previous tutorial for introduction to […]

“Java generics” gives the ability to parameterize a type or method and use it in a generic way. A Java class can be defined using a parameter type and the defined parameter can be used inside that class scope as a formal type. For example, in Java collections ArrayList will serve as an apt example […]