Skip to content
Related Articles

Related Articles

Scala Int equals(arg0: Any) method with example
  • Last Updated : 30 Jan, 2020

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



My Personal Notes arrow_drop_up
Recommended Articles
Page :