Created
October 12, 2020 13:30
-
-
Save ch8n/2235258a097ffa8f20ee43b5761727e9 to your computer and use it in GitHub Desktop.
map to hashmap in kotlin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Directly use the 4th constructor example | |
val contact = mapOf("chetan" to "[email protected]") | |
val hashMapOfContact = HashMap(contact) | |
//Or create and add all entries | |
val hashMapOfContact = HashMap<String,Int>() | |
hashMapOfContact.putAll(contact) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment