![]() Use the plusAssign( +=) operator: collection += element, collection += anotherCollection.Ĭheck whether a collection contains an element or elements In Kotlin, there are many operations on collections that look exactly the same as their counterparts in Java. ![]() This video by Sebastian Aigner, Kotlin Developer Advocate.Īll of the examples below use Java and Kotlin standard library APIs only. The second part of the guide, starting from Mutability, explains some of the differences by looking at specific cases.įor an introduction to collections, see the Collections overview or watch It is divided into operations that are the sameĪnd operations that exist only in Kotlin. ![]() The first part of this guide contains a quick glossary of operations on the same collections in Java and Kotlin. It will help you migrate from Java to Kotlin and write your code in the authentically Kotlin way. This guide explains and compares collection concepts and operations in Java and Kotlin. ![]() Collections are groups of a variable number of items (possibly zero) that are significant to the problem being solved and are commonly operated on. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |