Open In App

Scala Int intValue() method with example

The intValue() method is utilized to return the int value of the specified value.

Method Definition: def intValue(): Byte



Return Type: It returns the int value of the given value.

Example #1:




// Scala program of Int intValue
// method 
    
// Creating object 
object GfG 
{  
    
    // Main method 
    def main(args:Array[String]) 
    
        
        // Applying intValue method 
        val result = (15).intValue
            
            
        // Displays output 
        println(result) 
        
    

Output:

15

Example #2:




// Scala program of Int intValue
// method 
    
// Creating object 
object GfG 
{  
    
    // Main method 
    def main(args:Array[String]) 
    
        
        // Applying intValue method 
        val result = (1586).intValue
            
            
        // Displays output 
        println(result) 
        
    
}  

Output:
1586

Article Tags :