Kotlin in Action by Dmitry Jemerov

Kotlin in Action by Dmitry Jemerov

Author:Dmitry Jemerov
Language: eng
Format: epub
Publisher: Manning Publications

How does the separation between read-only and mutable collections work? Didn’t we say earlier that Kotlin collections are the same as Java collections? Isn’t there a contradiction? Let’s see what really happens here.

6.3.3. Kotlin collections and Java

It’s true that every Kotlin collection is an instance of the corresponding Java collection interface. No conversion is involved when moving between Kotlin and Java; there’s no need for wrappers or copying data. But every Java collection interface has two representations in Kotlin: a read-only one and a mutable one, as you can see in figure 6.13.


Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.