Differentiate between Array and List in Scala.

devquora
devquora

Posted On: Feb 22, 2018

 

The differences between array and list in Scala are listed below-
  • An array is a sequential mutable data structure. Whereas, a list is an immutable recursive data structure.
  • In scala, an array is an invariant. Whereas, a list is a covariant data structure.
  • The size of an array is fixed and cannot be changed easily. Whereas, the size of a list may increase or decrease based on the operations performed by it.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Scala Interview Questions

    What do you mean by a Scala map?

    The collection of key-value pairs where the key can retrieve the values present in a map is known as a scala map. The k..

    Scala Interview Questions

    List the advantages of using scala over other functional programming languages.

    Some of the advantages due to which scala is preferred over other functional programming languages are listed below: As..

    Scala Interview Questions

    Tell the advantages of companion objects when used in Scala?

    Instead of having static methods or variables, scala has singleton or companion objects. These objects are then compile..