Answers for "how to get absolute value in scala"

0

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)
      
    }
}
Posted by: Guest on February-26-2022

Code answers related to "how to get absolute value in scala"

Browse Popular Code Answers by Language