Skip to content

Tag Archives: Scala-Map

The init() method is utilized to delete the last element of the map. It will return all the elements of the Map except the last… Read More
The mkString() method is utilized to represent the elements of the map as a string. Method Definition: def mkString: String Return Type: It returns the… Read More
This method is same as addString() method but here a start, a separator and an end is also included. Method Definition: def addString(sb: mutable.StringBuilder, start:… Read More
The min() method is utilized to find the smallest element of the map. Method Definition: def min: (A, B) Return Type: It returns the smallest… 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
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
The drop() method is utilized to delete the first ‘n’ elements. Method Definition: def drop(n: Int): Map[A, B] Return Type: It returns all the elements… Read More
The count() method is utilized to count pair of keys in the Map. Method Definition: def count(p: ((A, B)) => Boolean): Int Return Type: It… Read More
The equals() method is utilized to check whether the two maps have the same key-values pair or not. Method Definition: def equals(that: Any): Boolean Return… Read More
The empty() method is utilized to make the map empty. Method Definition: def empty: Map[A, B] Return Type: It returns an empty map. Example #1:… 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): Map[A, B]… Read More
The dropRight() method is utilized to delete the last ‘n’ elements. Method Definition: def dropRight(n: Int): Map[A, B] Return Type: It returns all the elements… Read More
The copyToArray() method is utilized in copying pair of keys of the Map to an Array. Method Definition: def copyToArray(xs: Array[(A, B)]): Unit Return Type:… Read More
The get() method is utilized to give the value associated with the keys of the map. The values are returned here as an Option i.e,… 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 map… Read More

Start Your Coding Journey Now!