As of Scala 2.8, all you have to do is to import the JavaConversions object, which already declares the appropriate conversions.
import scala.collection.JavaConversions._
This won’t work in previous versions though.
More Related Contents:
- Using Scala traits with implemented methods in Java
- How can I use a Scala singleton object in Java?
- Using a Java library with Scala reserved words
- How to convert a scala.List to a java.util.List?
- Convert Java Map to Scala Map
- Accessing scala.None from Java
- What are the reasons why Map.get(Object key) is not (fully) generic
- Sorting an ArrayList of objects using a custom sorting order
- Why should the interface for a Java class be preferred?
- Sorting a collection of objects [duplicate]
- How to remove duplicates from a list?
- How to convert a Map to List in Java?
- Big-O summary for Java Collections Framework implementations? [closed]
- How to use java.String.format in Scala?
- How to make a new List in Java
- Lambda expression to convert array/List of String to array/List of Integers
- Why we can’t do List mylist = ArrayList(); [duplicate]
- Iterating through a list in reverse order in java
- How to Serialize a list in java?
- Shuffle a list of integers with Java 8 Streams API
- Sign CSR using Bouncy Castle
- Iteration order of HashSet
- How to sort a Collection?
- Java Stream: divide into two lists by boolean predicate
- Memory barriers and coding style over a Java VM
- Rule of thumb for choosing an implementation of a Java Collection?
- How do I disambiguate in Scala between methods with vararg and without
- Arrays.asList give UnsupportedOperationException [duplicate]
- Spark spark-submit –jars arguments wants comma list, how to declare a directory of jars?
- How to create ArrayList (ArrayList) from array (int[]) in Java