Copyright © 2008-2018, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Browse - Programming Tips - Scala has many collection classes and it can also use the Java collections.
Date: 2013aug27 Language: Scala Q. Scala has many collection classes and it can also use the Java collections. What should I use? A. MUTABLE Use mutable.ArrayList when you want something with order than can change. Use mutable.Set when you want a set you can change. Use mutable.HashMap when you want a hash you can change. These require:import collection.mutableYou can convert a Java ArrayList into a Scala mutable.ArrayList with asScalaBuffer() IMMUTABLE I don't have preferences for immutable connections yet.
Add a commentSign in to add a comment