# Generics

DevFeed: [Generics](<https://devfeed.tech/articles/generics-25057.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-generics/>)

Author: author@typealias.com (Dave Leeds)

Published: 2024-03-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [generics](<https://devfeed.tech/topics/generics.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [classes](<https://devfeed.tech/tags/classes.md>), [collections](<https://devfeed.tech/tags/collections.md>), [enum-class](<https://devfeed.tech/tags/enum-class.md>), [function](<https://devfeed.tech/tags/function.md>), [generics](<https://devfeed.tech/tags/generics.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-generic-function](<https://devfeed.tech/tags/kotlin-generic-function.md>), [kotlin-generics](<https://devfeed.tech/tags/kotlin-generics.md>), [kotlin-parameterized-types](<https://devfeed.tech/tags/kotlin-parameterized-types.md>), [kotlin-type-argument](<https://devfeed.tech/tags/kotlin-type-argument.md>), [kotlin-type-erasure](<https://devfeed.tech/tags/kotlin-type-erasure.md>), [kotlin-type-parameter](<https://devfeed.tech/tags/kotlin-type-parameter.md>), [kotlin-type-parameter-constraint](<https://devfeed.tech/tags/kotlin-type-parameter-constraint.md>), [kotlin-type-safety](<https://devfeed.tech/tags/kotlin-type-safety.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [list](<https://devfeed.tech/tags/list.md>), [map](<https://devfeed.tech/tags/map.md>), [pair](<https://devfeed.tech/tags/pair.md>), [programming](<https://devfeed.tech/tags/programming.md>)

## AI overview

A tutorial introducing Kotlin generics through collection types such as List, Pair, and Map, using a beverage-menu example with classes and an enum class.

## Source excerpt

All the way back in Chapter 8, when we introduced collections, we saw our first generic type: List<String> ... then we saw more generics in Chapter 9 when we looked at the Pair and Map classes. In order to stay focused on learning about collection types, we glossed over the details about these classes. Well, we've put off learning about them for long enough! It's finally time for us to gain a full understanding of generics, so buckle up!