October 2018
Intermediate to advanced
370 pages
9h 15m
English
In mathematics, a set is a collection of unique values that does not allow duplicates. The hashCode is a function that generates a unique number for each input.
Let's take a look at the importance of the hashCode function:
class Person(var name : String, var age: Int, var height: Double)val p1 = Person("Abid", 40, 6.0)val p2 = Person("Abid", 40, 6.0)val p3 = Person("Khan", 40, 6.0)
val set = hashSetOf(p1,p2,p3)
Read now
Unlock full access