Answers for "how to get max of list in scala"

0

how to get max of list in scala

// Scala program of max()
// method
  
// Creating object
object GfG
{ 
  
    // Main method
    def main(args:Array[String])
    {
      
        // Creating a list
        val m1 = List(1, 2, 3)
          
        // Applying max method
        val result = m1.max
          
        // Displays output
        println(result)
      
    }
}
Posted by: Guest on February-26-2022

Browse Popular Code Answers by Language