Explain the difference between array and list in scala?
Answer Posted / Amit Kumar Bhaskar
An Array in Scala is a fixed-size, zero-indexed collection of elements. It is accessed by an index, and its size must be specified at creation. A List in Scala, on the other hand, is a mutable or immutable (depending on the type used) collection that can grow or shrink as needed, with no defined order. Lists are more flexible but less efficient for random access than arrays.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers