scala-notes
  • Introduction
  • functional programming
  • Compiling Running Program
  • Tuples
  • Collections
    • Maps
  • Control Structures
    • For Loop
    • Case
    • WhileDoWhile
  • Functions
    • Named Functions
    • [Function Values]Using Functions as Variables
    • Syntax
    • Notes
  • Scala Symbols
  • REPL Editor Notes
    • Paste Mode
  • Statically Typed
  • References
  • Classes
    • Primary Constructor
    • Getters And Setters
    • Variations
  • Java vs Scala
    • Classes - Primary Constructor
    • Scala Syntax
  • Ways To Run program
  • functional programming
Powered by GitBook
On this page

Was this helpful?

  1. Collections

Maps

PreviousCollectionsNextControl Structures

Last updated 5 years ago

Was this helpful?

Maps are collections of key value pairs, similar to dicts in Python or Hashes in Ruby. Keys in a map are unique, and any value can be retrieved based upon a key.Values in a map do not have to be unique, however. Maps have methods to return a collection containing keys or values.

Maps are immutable by default but can mutable using the scala.collection.mutable.Map class. Mutable maps can then be appended to or updated.