The equals(arg0: Any) method is utilized to return true if the two specified int value is equal else false.
Method Definition: def equals(arg0: Any): Boolean
Return Type: It returns true if the two specified int value is equal else false.
Example #1:
// Scala program of Int equals // method // Creating object object GfG
{ // Main method
def main(args : Array[String])
{
// Applying equals method
val result = ( 66 ).equals( 22 )
// Displays output
println(result)
}
} |
Output:
false
Example #2:
// Scala program of Int equals // method // Creating object object GfG
{ // Main method
def main(args : Array[String])
{
// Applying equals method
val result = ( 22 ).equals( 22 )
// Displays output
println(result)
}
} |
Output:
true