![]() In Kotlin, listOf() is used to create a list and we can pass different data types at the same time. IntRange. The same value can be associated with multiple keys. ![]() Each key in a map is unique, and it can only be associated with one value. ![]() Maps can store a collection of zero or more key-value pairs. They’re also known as dictionaries or associative arrays in other programming languages. You can traverse through collection (list, map, set) using the for loop. Your for-loop is logging each item in the list, but you only have one range in your list. Maps are a common data structure in computer science. Iterate through collection using for loopĪ collection usually contains a number of objects of the same type and these objects in the collection are called elements or items. The syntax of for loop in Kotlin is: for (item in collection) ")*/
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |