Values & References9 / 16
Up next

Aliasing

import scala.collection.mutable.ArrayBuffer

@main def main(): Unit =
  val a = ArrayBuffer(1, 2, 3)
  // b is another name for the SAME buffer
  val b = a
  b += 4
  // the change shows through a as well
  println(a)
What you're solving

two names, one object