What are generics in Java?

In this lesson, we talk about generics. Or rather, about the basics that you need to know when diving into generics: what generics are and why you need them at all. The topic is very important, and you definitely need to understand it. Forward!

Generics for cats

Generics are a great tool to help developers hint additional information to the compiler for type safety and flexibility. This in-depth article, written by a member of the CodeGym community, takes another lap around "generics".

Type erasure

This lesson is devoted to some features of generics as well as pitfalls that arise when working with them. Because generics were not part of Java when the language was created, type erasure has been added. What's that? We'll figure it out.

Wildcards in generics

Wildcards are a very important feature of generics and definitely deserve a separate lesson. This is an interesting and simple topic. You're going to love it :)

Using varargs when working with generics

Using varargs with generics can lead to rather unpleasant consequences — heap pollution. In this lesson, we conclude our discussion of various features of generics in Java.