© 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 
(1)
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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.