Skip to content

Category Archives: Scala

The toSet() method is utilized to display a set from the Scala SortedMap. Method Definition: def toSet: Set[A] Return Type: It returns a set from… Read More
The contains() method of Scala is equivalent to the isDefinedAt method of Scala but the only difference is that isDefinedAt is observed on all the… Read More
The apply() is utilized to search a key in the stated SortedMap. Method Definition: m1.apply(“key”) Here m1 is SortedMap. Return Type: It returns the value… Read More
This method is identical to the addString() method but here a separator is also included. Method Definition: def addString(b: StringBuilder, sep: String): StringBuilder Where, sep… Read More
The addString() method is utilized to add the elements of the SortedMap to the String Builder. Method Definition: def addString(b: StringBuilder): StringBuilder Return Type: It… Read More
The iterator method is utilized to give an iterator. Method Definition: def iterator: Iterator[(A, B)] Return Type: It returns a non-empty iterator for non-empty SortedMap… Read More
The get() method is utilized to give the value associated with the keys of the SortedMap. The values are returned here as an Option i.e,… Read More
The dropWhile() method is utilized to delete the elements until the stated condition is satisfied. Method Definition: def dropWhile(p: ((A, B)) => Boolean): SortedMap[A, B]… Read More
The empty() method is utilized to make the SortedMap empty. Method Definition: def empty: SortedMap[A, B] Return Type: It returns an empty SortedMap. Example #1:… Read More
The equals() method is utilized to check whether the two SortedMaps have the same key-values pair or not. Method Definition: def equals(that: Any): Boolean Return… Read More
The count() method is utilized to count pair of keys in the SortedMap. Method Definition: def count(p: ((A, B)) => Boolean): Int Return Type: It… Read More
The drop() method is utilized to delete the first ‘n’ elements. Method Definition: def drop(n: Int): SortedMap[A, B] Return Type: It returns all the elements… Read More
The init() method is utilized to delete the last element of the SortedMap. It will return all the elements of the SortedMap except the last… Read More
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… Read More
The mkString() method is utilized to represent the elements of the SortedMap as a string. Method Definition: def mkString: String Return Type: It returns the… Read More

Start Your Coding Journey Now!