Values & References14 / 16
Up next

Value vs reference types

@main def main(): Unit =
  // Int is a value type; String is a reference type
  val n: Int = 42
  val s: String = "hi"
  // both are subtypes of Any
  val items: List[Any] = List(n, s)
  println(items)
What you're solving

Int is a value, String a reference