What is Java Generics?

Java 8Object Oriented ProgrammingProgramming

Java Generic methods and generic classes enable programmers to specify, with a single method declaration, a set of related methods, or with a single class declaration, a set of related types, respectively.

Generics also provide compile-time type safety that allows programmers to catch invalid types at compile time.

Updated on 30-Jul-2019 22:30:20