The List type is a linear, immutable sequence. The next several sections briefly demonstrate the List, Vector, and ArrayBuffer types. ListBuffer is used when you’re mixing styles, such as building a list. List and Vector are often used when writing code in a functional style.ĪrrayBuffer is commonly used when writing code in an imperative style. The recommended, general-purpose, “go to” sequential collections for the combinations of mutable/immutable and indexed/linear are shown here: Type/Categoryįor example, if you need an immutable, indexed collection, in general you should use a Vector.Ĭonversely, if you need a mutable, indexed collection, use an ArrayBuffer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |