Lists
Learn how to create and use lists in Kotlin to store and manipulate multiple values in one data structure.
Collections are a central feature of any programming language. They allow storing multiple values – such as your list of favorite books – in one convenient data structure which can then be stored and accessed with a single variable.
The fundamental collection types you’ll master in the following lessons are:
- Lists
- Sets
- Arrays*
- Maps
*Arrays are not part of the actual Collections API but are included here because they’re also a data structure for storing multiple elements.
Creating a List #
Kotlin provides three convenient functions to initialize lists:
Get hands-on with 1200+ tech skills courses.