Created
October 12, 2020 13:20
-
-
Save ch8n/0ddd965af180c0e0a41d96e62c40f34c to your computer and use it in GitHub Desktop.
Hash map kotlin and java signature
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
// Kotlin signature | |
typealias HashMap<K, V> = HashMap<K, V> | |
// Java signature | |
class HashMap<K,V> | |
extends AbstractMap<K,V> | |
implements Map<K,V>, Cloneable, Serializable | |
// AbstractMap<K,V> is a skeletal implementation of the Map interface, | |
// Java's Map<K,V> is very close to MutableMap<K,V> than kotlin's Map<K,V> | |
// i.e it contains mutable opertaions internally, though use structures named | |
// similar to Kotlin's Map<K,V> like Map.Entry but are infact Mutable Entry | |
Java HashMap has three constructors | |
- HashMap() | |
- HashMap(int initialCapacity) | |
- HashMap(int initialCapacity,float fillRatio) | |
- HashMap(Map<K,V> fromMap) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment