Scala ListSet max() method with example Last Updated : 17 Feb, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report In Scala ListSet, max() method is utilized to find the largest element of all the elements in the stated list. Method Definition: def max[B >: A](implicit ord: math.Ordering[B]): A Return Type: It returns the largest of all the elements in the stated listSet. Example 1: Scala // Scala program of min() // method import scala.collection.immutable._ // Creating object object GfG { // Main method def main(args:Array[String]) { // Creating a list val m1 = ListSet(1, 2, 3) // Applying max method val result = m1.max // Displays output println(result) } } Output:3 Example 2: Scala // Scala program of min() // method import scala.collection.immutable._ // Creating object object GfG { // Main method def main(args:Array[String]) { // Creating a list val m1 = ListSet(1, 2, -3) // Applying max method val result = m1.max // Displays output println(result) } } Output:2 Comment More infoAdvertise with us Next Article Scala Int max() method with example I IshwarGupta Follow Improve Article Tags : Scala Scala-Method scala-collection Similar Reads Scala List max() method with example The max() method is utilized to find the largest element of all the elements in the stated list. Method Definition: def max[B >: A](implicit ord: math.Ordering[B]): A Return Type: It returns the largest of all the elements in the stated list. Example #1: Scala // Scala program of max() // method 1 min read Scala Iterator max() method with example The max() method belongs to the concrete value members of the class Abstract Iterator. It is defined in the classes IterableOnceOps. It is utilized to find the largest element. Method Definition : def max[B >: A](implicit ord: math.Ordering[B]): A Where, B is the type over which the ordering is d 1 min read Scala Int max() method with example The max() method is utilized to return the maximum value of the two specified int numbers. Method Definition: (First_Number).max(Second_Number) Return Type: It returns true the maximum value of the two specified int numbers. Example #1: Scala // Scala program of Int max() // method // Creating objec 1 min read Scala Map last() method with example The last() method is utilized to return the last element of the map. Method Definition: def last: (A, B) Return Type: It returns the last element of the map. Below is the example of Map last() method. Example #1: Scala // Scala program of last() // method // Creating object object GfG { // Main meth 1 min read Scala Float max() method with example The max() method is utilized to return the maximum value of the two specified float numbers. Method Definition: (First_Number).max(Second_Number) Return Type: It returns the maximum value of the two specified float numbers. Example #1: Scala // Scala program of Float max() // method // Creating obje 1 min read Scala ListSet size() method with example In Scala ListSet, size() method is utilized to find the number of elements of the stated listSet. Method Definition: def size(): Int Return Type: It returns the number of elements in the stated listSet. Example 1: Scala // Scala program of size() // method import scala.collection.immutable._ // Crea 1 min read Like