Scala Map tail() method with example Last Updated : 13 Aug, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The tail() method is utilized to display all the elements of the map except the first one. Method Definition: def tail: Map[A, B] Return Type: It returns all the elements of the stated map except the first one. Example #1: Scala // Scala program of tail() // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Creating a map val m1 = Map(3 -> "geeks", 4 -> "for", 2 -> "cs") // Applying tail method val result = m1.tail // Displays output println(result) } } Output: Map(4 -> for, 2 -> cs) Example #2: Scala // Scala program of tail() // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Creating a map val m1 = Map(3 -> "geeks", 4 -> "for", 3 -> "geeks") // Applying tail method val result = m1.tail // Displays output println(result) } } Output: Map(4 -> for) Comment More infoAdvertise with us Next Article Scala Set max() method with example N nidhi1352singh Follow Improve Article Tags : Scala Scala Scala-Method Scala-Map Similar Reads Scala Map takeRight() method with example The takeRight() method is utilized to select the last 'n' elements of the map. Method Definition: def takeRight(n: Int): Map[A, B] Return Type: It returns the last 'n' elements of the map. Example #1: Scala // Scala program of takeRight() // method // Creating object object GfG { // Main method def 1 min read Scala Stack max() method with example In Scala Stack class, the max() method is utilized to return the largest method of the stack. Method Definition: def max: A Return Type: It returns the largest element of the stack. Example #1: Scala // Scala program of max() // method // Import Stack import scala.collection.mutable._ // Creating ob 1 min read Scala Set max() method with example The max() method is utilized to find the largest element of all the elements in the set. Method Definition: def max: A Return Type: It returns the largest of all the elements in the set. Example #1: Scala // Scala program of max() // method // Creating object object GfG { // Main method def main(arg 1 min read Scala Set tail() method with example The tail() method is utilized to return a set consisting all the elements except the first element of the set. Method Definition: def tail: Set[A] Return Type: It returns a set consisting of all the elements except the first element of the set. Example #1: Scala // Scala program of tail() // method 1 min read Scala Float until() method with example The until() method is utilized to return a range starting from first point to end point. Here the first point is inclusive but the endpoint is exclusive. Method Definition: (First_Point).until(End_Point) Return Type: It returns the created range. Example #1: Scala // Scala program of Float until() / 1 min read Scala Short max() method with example The max() method is utilized to find the maximum of the two specified Short types. Method Definition: def max(that: Short): Short Return Type: It returns the number of type Short with the maximum value. Example: 1# Scala // Scala program of max() // method // Creating object object GfG { // Main met 1 min read Like