Difference between Array and List in Scala?



Difference between Array and List in Scala?..

Answer / Tauqeer Ahmad

In Scala, Arrays are fixed-size, mutable data structures with homogeneous elements, whereas Lists can be either mutable or immutable (ListBuffer for mutable lists, List for immutable lists) and can contain heterogeneous elements. Arrays have faster access times than lists due to their contiguous memory allocation, but lists are more flexible in terms of their size and element types.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

What are case classes in scala?

1 Answers  


Is scala better than java?

1 Answers  


What is the current latest version of scala? What is the major change or update in scala 2.12?

0 Answers  


How many public class files are possible to define in Scala source file?

1 Answers  


What is seq in scala collection?

1 Answers  


Difference between Scala’s Int and Java’s java.lang.Integer? What is the relationship between Int and RichInt in Scala?

1 Answers  


What is the use of ‘???’ in Scala-based Applications?

1 Answers  


Is scala the best language ever?

1 Answers  


Which IDEs support Play and Scala-Based Applications Development and how?

1 Answers  


Explain the scope provided for variables in scala.

1 Answers  


What is a closure?

1 Answers  


What is an abstract class in scala?

1 Answers  


Categories