Get free points Front-end week
Get up to 40 % extra points for free! More info
Save up to 80 % on HTML & CSS + JavaScript e-learning! Only this week!

Lesson 4 - Dictionaries and sets in Kotlin

In the previous lesson, Multidimensional arrays in Kotlin, we took a little detour to multidimensional arrays. Today's Kotlin tutorial is about dictionaries and sets.

Dictionaries

The idea of the dictionary is that we often need to access an element using a key. This concept works the same as with arrays where the keys (indexes) are numeric. The dictionary allows us to index using any data type, e.g. a string. We then access the elements of the collection using these strings. An analogy can be found in a real paper dictionary where we have each string word associated with the translation, explanation, other meanings, etc.

The data in this collection is stored in a special way known as hashing. This approach allows us to


 

...End of the preview...

Premium article

Premium article

ict.social is a large database made up of manuals and tutorials, whose main goal is to provide high-quality IT education to everyone. We started out in the Czech republic, where we display roughly a million articles per month and receive plenty of gratitude from our users. Thanks to our successful establishment, we are now bringing these articles to the rest of the world.

Although we are trying to keep our content free of charge, maintaining the site is a huge effort for everyone involved. Therefore, some content (exercises and more advanced material) costs network points. Don't worry, they're really cheap :)

Article description

Requested article covers this content:

In this Kotlin tutorial, we'll discuss dictionaries and sets, describe the Set and Map interfaces and test the new collections on examples.

Buy just this article

To access the article, you need 10 points
Currently, you have 0 points
You gain 10 points for adding an article to the site, or for $0.90

Buying this article gives you unlimited access to it forever. You will learn some more and help us keep giving our site maintenance which helps you and others get better futures. It's a win-win.

This article is licensed :Premium, by buying this article, you agree with the terms of use.

You gain points by supporting our network. This is done by sending a helpful amount of money to support the site, or by creating content for the network.

You can get points immediately using:

Credit card SMS Wire transfer
Credit card SMS Wire transfer

 

Article has been written for you by Samuel Kodytek
Avatar
I'm intereseted in JVM languages and Swift
Previous article
Multidimensional arrays in Kotlin
All articles in this section
Collections in Kotlin
Activities (2)