Scala has both a mutable and an immutable Map , but it has only an immutable List. If you want a mutable List you need a ListBuffer.
I don't understand why this is so. Any one knows?.
You can choose between these:
scala.collection.mutable.DoubleLinkedListscala.collection.mutable.LinkedListscala.collection.mutable.ListBufferscala.collection.mutable.MutableListSo, yes, Scala has mutable lists :-)
I hope that this article may be of some use to you. The diagram at the bottom of the page is particularly useful in providing the mutable and immutable classes.
http://www.scala-lang.org/docu/files/collections-api/collections_1.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With