© Vaskaran Sarcar 2020
V. SarcarInteractive Object-Oriented Programming in Javahttps://doi.org/10.1007/978-1-4842-5404-2_12

12. Generic Programming

Vaskaran Sarcar1 
Bangalore, Karnataka, India

Generic programming is an important concept in Java. It was introduced in JDK 5, and since then it has become an integral part of Java programming. The power of generic programming is enormous. It will make your program type-safe and flexible. Generics are often used with collections frameworks. So, once you are familiar with Java collections, you will be better able to use generics. This chapter provides a brief overview of generics.

To help you understand the power of generics, I’ll start with a non-generic program and then write a generic program. Later, ...

Get Interactive Object-Oriented Programming in Java: Learn and Test Your Programming Skills now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.