This post originated from an RSS feed registered with Java Buzz
by justin cater.
Original Post: How and when to use Generics
Feed Title: Java Code Geeks
Feed URL: http://feeds.feedburner.com/JavaCodeGeeks
Feed Description: Java 2 Java Developers Resource Center
In this lesson we will discuss Generics. The idea of generics represents the abstraction over types (well-known to C++ developers as templates). It is a very powerful concept that allows to develop abstract algorithms and data structures and to provide concrete types to operate on later. Generics revolutionized the way Java programs are being written, delivering much stronger type guaranties and making code significantly safer.
In this section we are going to cover the usage of generics everywhere, starting from interfaces, classes and methods. Providing a lot of benefits, generics however do introduce some limitations and side-effects which we also are going to cover.