Scala Set min() method with example Last Updated : 18 Oct, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The max() method is utilized to find the smallest element of all the elements in the stated list. Method Definition: def min: A Return Type: It returns the smallest of all the elements in the stated list. Example #1: Scala // Scala program of min() // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Creating a set val s1 = Set(1, 2, 3) // Applying min method val result = s1.min // Display output println(result) } } Output: 1 Example #2: Scala // Scala program of min() // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Creating a set val s1 = Set(5, 11, 23, 72, 14, 21, 118) // Applying min method val result = s1.min // Display output println(result) } } Output: 5 Comment More infoAdvertise with us Next Article Scala Set min() method with example R rupesh_rao Follow Improve Article Tags : Scala Scala Scala-Method scala-collection Scala-Set +1 More Similar Reads Scala Short min() method with example The min() method is utilized to find the minimum of the two specified Short types. Method Definition: def min(that: Short): Short Return Type: It returns the number of type Short with the minimum value. Example: 1# Scala // Scala program of min() // method // Creating object object GfG { // Main met 1 min read Scala Stack min() method with example In Scala Stack class, the min() method is utilized to return the smallest element of the stack. Method Definition: def min: A Return Type: It returns the smallest element of the stack. Example #1: Scala // Scala program of min() // method // Import Stack import scala.collection.mutable._ // Creating 1 min read Scala TreeSet min() method with example The min() method is utilized to return the smallest element of the TreeSet. Method Definition: def min: A Return Type: It returns the smallest element of the TreeSet. Example #1: Scala // Scala program of min() // method // Import TreeSet import scala.collection.mutable._ // Creating object object G 1 min read Scala SortedSet min() method with example The min() method is utilized to find the smallest element of all the elements in the stated list. Method Definition: def min: A Return Type: It returns the smallest of all the elements in the stated list. Example #1: Scala // Scala program of min() // method import scala.collection.immutable.SortedS 1 min read Scala SortedMap min() method with example The min() method is utilized to find the smallest element of the SortedMap. Method Definition: def min: (A, B) Return Type: It returns the smallest element of the SortedMap. Example #1: Scala // Scala program of min() // method import scala.collection.immutable.SortedMap // Creating object object Gf 1 min read Like