Open In App

Scala Int longValue() method with example

Improve
Improve
Like Article
Like
Save
Share
Report

The longValue() method is utilized to return the long value of the specified value.

Method Definition: def longValue(): Byte

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

Example #1:




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


Output:

15

Example #2:




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


Output:

1586


Last Updated : 30 Jan, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads