brackets

How to import multiple members in Scala (wildcard and curly braces syntax)

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is one the shorter recipes, Recipe 7.2, “How to import multiple members in Scala (wildcard and curly braces syntax).”

Problem

You want to import one or more members into the scope of your current program.

Solution

This is the syntax for importing one class:

import java.io.File

You can import multiple classes the Java way: