- Hands-On Design Patterns with Kotlin
- Alexey Soshin
- 84字
- 2021-06-25 20:49:30
Collection types in Kotlin
One of the main Kotlin goals is Java interoperability. So it's no wonder that Kotlin collections are interoperable with Java. When you specify that your functions receives List<T>, it is actually the same Java List<T> you're familiar with.
But Kotlin differentiates between mutable and immutable collections. The listOf() function is delegated to Arrays.asList(), and produces an immutable list, while mutableListOf() simply calls ArrayList().
On top of data, Kotlin collection has many useful extension methods, which we'll discuss later.
推薦閱讀
- scikit-learn Cookbook
- GAE編程指南
- AngularJS Testing Cookbook
- Building a Home Security System with Raspberry Pi
- C++面向對象程序設計(微課版)
- Building a Quadcopter with Arduino
- Apache Kafka Quick Start Guide
- Azure Serverless Computing Cookbook
- Creating Data Stories with Tableau Public
- Struts 2.x權威指南
- Scratch編程從入門到精通
- Unity 5 Game Optimization
- Python深度學習與項目實戰
- Elasticsearch實戰(第2版)
- Learning Unity Physics