Friday, 25 March 2016

Java 1.5 Generics Tutorial: How Generics in Java works with Example of Collections, Best practices, Gotchas

Java Generics Tutorial
Generics in Java is one of important feature added in Java 5 along with Enum, autoboxing and varargs, to provide compile time type-safety. Generics is also considered to be one of the tough concepts to understand in Java and somewhat it’s true as well. I have read many articles on generics in Java, some of them are quite good and detailed but I still felt that those are either too much technical or exhaustively detailed, so I thought to write a simple yet informative article on Java generics to give a head start to beginners without bothering their head too much. In this Java generics tutorial, I will cover How Generics works in Java,  some mysterious wildcards in Generics and some important points about Generic in Java. I will try explaining generics concept in simple words and simple examples.
Read more »

No comments:

Post a Comment