What is the equvalent for .Net ArrayList of a mutable type in Scala 2.8?

What type can I use in Scala 2.8 to store a list of values? In C #, I would use an ArrayList.

+3
source share
3 answers

As others pointed out, you want to ArrayBuffer. In general, in Scala, a buffer is a resizable, mutable, linear dataset. In addition to ArrayBuffer, a ListBufferworks like a C # or Java variable list, and, in fact, JListWrapperwraps Java Listand works basically in the same way.

API . .

+8
+4

You can use ArrayBuffer.

Here you can see other volatile collections: scala.collections.mutable

+4
source

Source: https://habr.com/ru/post/1764885/


All Articles