In Scala mutable collections, SortedSet isEmpty() method is utilized to test if the SortedSet is empty or not.
Method Definition: def isEmpty: Boolean
Return Type: It returns true if the SortedSet is empty else it returns false.
Example #1:
import scala.collection.mutable.SortedSet
object GfG
{
def main(args : Array[String])
{
val s 1 = SortedSet( 1 , 2 , 3 , 4 , 5 )
val result = s 1 .isEmpty
println(result)
}
}
|
Example #2:
import scala.collection.mutable.SortedSet
object GfG
{
def main(args : Array[String])
{
val s 1 = SortedSet()
val result = s 1 .isEmpty
println(result)
}
}
|