![]() Val stringArray = arrayOf( "one ", "two ", "three ", "four ") Very helpful if we want to quickly create two (Pair) or three objects (Triple) as a collection □Pair □Class definition Map – associative dictionary or map of keys and values.Array – indexed fixed-sized collection of objects and primitives.Pair – a tuple of two values and Triple – a tuple of three values.So in terms of collections these are the main ones: An important thing to mention here is that immutable collections in Kotlin are simply read-only. The main difference between Java and Kotlin is that in Kotlin we have mutable and immutable collections. Just like Java, all collection interfaces are originated from the Iterable interface. In Kotlin there are different flavors of collections. The subject covered in this new post is represented by Collections and data operations applied to them.Ĭollections are actually a set of classes and interfaces that provides high quality implementations of useful data structures and algorithms that help developers to reduce the programming effort and time. It’s time to continue our learning path in Kotlin.
0 Comments
Leave a Reply. |