Scala Int hashCode() method with example
Last Updated :
30 Jan, 2020
The hashCode() method is utilized to return hash value of the specified int value.
Method Definition: def hashCode(): Int
Return Type: It returns hash value of the specified int value.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 22 ).hashCode
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 5645 ).hashCode
println(result)
}
}
|
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...