Scala Mutable SortedMap isEmpty() method with example Improve Improve Like Article Like Save Share Report The isEmpty() method is utilized to check if the given SortedMap is empty or not. Method Definition: def isEmpty: Boolean Return Type: It returns true if the stated SortedMap is empty else returns false. Example #1: // Scala program of isEmpty() // method import scala.collection.SortedMap // Creating object object GfG { // Main method def main(args:Array[String]) { // Creating SortedMap val m1 = SortedMap(3 -> "geeks", 1 -> "for", 2 -> "cs", 3 -> "geeks") // Applying isEmpty method val result = m1.isEmpty // Displays output println(result) } } Output: false Example #2: // Scala program of isEmpty() // method import scala.collection.SortedMap // Creating object object GfG { // Main method def main(args:Array[String]) { // Creating SortedMap val m1 = SortedMap(2 -> 4) // Applying isEmpty method val result = m1.isEmpty // Displays output println(result) } } Output: false Last Updated : 04 May, 2020 Like Article Save Article Previous Scala Mutable SortedMap mkString() method with a start, a separator and an end with example Next Scala Mutable SortedMap foreach() method with example Share your thoughts in the comments Add Your Comment Please Login to comment...