8 Basic types, collections, and arrays
This chapter covers
- Primitive and other basic types and their correspondence to the Java types
- Kotlin collections, arrays, and their nullability and interoperability stories
Beyond its support for nullability, Kotlin’s type system has several essential features to improve the reliability of your code and implements many lessons learned from other type systems, including Java’s. These decisions shape the way you work with everything in Kotlin code, from primitive values and basic types to the hierarchy of collections found in the Kotlin standard library. Kotlin introduces features such as read-only collections and refines or doesn’t expose parts of the type system that have turned out to be problematic ...
Get Kotlin in Action, Second Edition 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.