Generics let you write classes and functions that work with many types while staying type-safe. Instead of duplicating code for each type, you declare a type parameter such as T and the compiler checks the types for you. You've already used generics every time you wrote List<String> or Map<String, Int>.
Extensions let you add new functions and properties to existing classes without inheriting from them or changing their source code. You'll learn to write extension functions and extension properties that make your code read more naturally, and see how much of the Kotlin standard library is built from them.
Watch the lessons in order, then continue on to Coroutines.
A beginner-friendly introduction to Kotlin generics and type parameters for writing type-safe, reusable code.
Shows how generics are beneficial and how they can increase the reusability of your code.
Teaches how to add new methods to existing classes without modifying their source code.
Covers how to use extension functions and extension properties in Kotlin.