Open In App

Scala Int doubleValue() method with example

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

Method Definition: def doubleValue(): Byte



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

Example #1:




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

Output:

15.0

Example #2:




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

Output:
1586.0

Article Tags :