Programming in Kotlin: Collections & Lambdas
Learn how to create and work with collections of data using differenct collection types in Kotlin and explore lambdas, which is an integral part in many Kotlin codebases. By Emmanuel Okiche.
Learning path
This is part of the Android & Kotlin for Beginners learning path. View path.
Who is this for?
Beginner developers who’ve had some experience with the fundamentals of the Kotlin language, who want to gain in-depth knowledge of working with collections and lambdas in Kotlin.
Covered concepts
- Collections
- Pairs & Triples
- Lambdas
- Higher Order Functions
- Iterating Over Collections
Part 1: Store Data in Collections
Welcome to Programming in Kotlin: Collections & Lambdas! Get an overview of the course, and what topics you’ll cover in the first part.
Learn how to group pieces of data in Pairs and Triples, how to work with such constructs, and how to destructure them.
Challenge time! Use what you’ve learned about Pairs and Triples to solve a short challenge.
Learn what collections of data are and how they behave in memory, then learn about Arrays, a static collection type.
Upgrade from an Array to a List, a dynamic collection of data. Compare the performance between an Array and a List.
Practice what you’ve learned about Arrays and Lists, the two basic collection types, in a challenge!
Learn how to iterate over the Array and List collection types using for loops.
Practice iterating over two dimensional collections - matrices, and using exit-early strategies with break and continue.
Review what you’ve learned in the first part of the course.
Part 2: Explore More Collections
Review the concepts you’ve learned so far, and learn about two new collection types - the Map and the Set.
Learn what a Map is, how to create one, and how to store key value pairs within the map.
Expand your knowledge of maps, to add and remove values, mutate the contents, and learn about three types of mutability.
Use what you’ve learned about Maps to solve a fun challenge. Let’s get started!
Learn what a Set is, and how it’s unique compared to other collections. Create and use Sets.
Challenge time! In this episode, practice using Sets to store unique pieces of data.
Review the collections you learned about in this part of the course, and find out what’s up next!
Part 3: Lambdas & Higher-Order Functions
Get an overview of what we’ll be covering in this part; “lambdas” and learn why it’s important.
Review some fundamentals about how functions and lambdas work, as well as their various syntax options.
Find out about how lambdas capture data and how they relate to the concept of higher-order functions.
Use common higher order function provided by Kotlin to traverse through collections.
Learn how to chain higher order functions and see how this can be useful.
Practice what you have learned about using lambdas and collections with this series of hands-on coding challenges.
Get a refresher of what was covered in this course and what to expect in the next course in your Android development journey.