In order to get all the values from a Scala map, we need to use values method (to get all the values as an Iterable) and if we want to get the values as an iterator, we need to use valuesIterator method. Now, lets check some examples.
MapLike(geeks, for, cs)
Here, values method is utilized.
Here, valuesIterator method is utilized.
- Scala sum Map values
- Scala Product Map Values
- How to Reverse keys and values in Scala Map
- Scala Tutorial – Learn Scala with Step By Step Guide
- Scala Map
- Set in Scala | Set-1
- Scala | Either
- Set in Scala | Set-2
- Scala | Value Classes
- Scala Byte &(x: Int): Int
- Scala Byte *(x: Int): Int
- Scala this keyword
- Scala Set sum() method with example
- Scala Int !=(x: Int) method with example
- Scala Int >>>(x: Int) method with example
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.