Open In App

Scala Short longValue() method with example

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

Article Tags :