Mutable list

Unlike Java, Kotlin has a standard set of collection class. But this kotlin.collections package is way more powerful than Java.

The mutableListOf() function is one of the functions of this package. It returns the new mutable list of the given object type. You can easily iterate over them. Since it's mutable, it's not thread-safe.

Get Hands-On Serverless Applications with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.