Ch 5 - Generic Programming (4)
Ch 5 - Generic Programming (4)
Data Structures
Generic Programming
Generics in Java
What is Generics?
Types of Java Generics
Generic Method
Generic Class
What is Generics?
Generics means parameterized types.
The idea is to allow type (Integer, String, … etc., and user-defined types) to be
a parameter to methods, classes, and interfaces.
Using Generics, it is possible to create classes that work with different data
types.
An entity such as a class, interface, or method that operates on a
parameterized type is a generic entity.