Open In App

Scala Short longValue() method with example

Improve
Improve
Like Article
Like
Save
Share
Report

The longValue() method is utilized to find if the Long value of the stated Short type.

Method Definition: def longValue(): Long

Return Type: It returns Long.

Example: 1#




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


Output:

1000

Example: 2#




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


Output:

899


Last Updated : 11 Nov, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads