Skip to content

Category Archives: Scala

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
This method is same as mkString() method but here a separator is also added. Method Definition: def mkString(sep: String): String Return Type: It returns the… Read More
This method is same as mkString() but here a start, a separator, and an end is also added. Method Definition: defmkString(start: String, sep: String, end:… Read More
The transform() method is utilized to transform the elements of the SortedMap into a mutable SortedMap. Method Definition: def transform(f: (K, V) => V): SortedMap.this.type… Read More
The tail() method is utilized to display all the elements of the SortedMap except the first one. Method Definition: def tail: SortedMap[A, B] Return Type:… Read More