Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SCALA

how to get absolute value in scala

// Scala program of Int abs()
// method
  
// Creating object
object GfG
{ 
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying abs method
        val result = (-5).abs
          
        // Displays output
        println(result)
      
    }
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #absolute #scala
ADD COMMENT
Topic
Name
1+9 =