January 2017
Intermediate to advanced
420 pages
9h 25m
English
Generics, or generic programming, is a technique whereby functions can be written in terms of types that are not specified when the function is written, and then later used for many different types. Generics is the term used in Java and Kotlin, but other names, such as parametric polymorphism and templates, are used in other languages for similar features.
In this chapter we will cover:
Consider a function called random() that, when given some elements, returns one element randomly. We don't need to know what the types of the elements are when we write this function, as we will not be ...
Read now
Unlock full access