June 2025
Intermediate to advanced
1129 pages
53h
English
“Earthly happiness means: Misfortune does not visit us too regularly.”—Karl Gutzkow (1811–1878)
In this chapter, you’ll learn about generics, which make your code more stable by providing the compiler with more type information.
Generics are among the most complex language constructs in Java. Because of this complexity, we’ll approach generics in two steps: first from the user’s side and then from the application programming interface (API) designer’s side. Taking advantage of generically declared types is rather easy, so let’s pick this low-hanging fruit first.
An important feature of Java is that the ...
Read now
Unlock full access