Generics in Kotlin

Generics means we use a class or an implementation in a very generic manner. For example the interface List allows us for code reuse. We are able to create a list of Strings, of integer values and we will have the same operations even if we have different types. So the list wraps a common functionality for each implementation.

Kotlin allows you to use parameters for methods and attributes, composing what is known as parameterized classes.

Continue reading “Generics in Kotlin”