Chapter 2. Scala Syntax, Scripts, and Your First Scala Programs

We're going to get our hands dirty with Scala code in this chapter. We'll write some Scala code, starting with the ubiquitous "Hello World," and moving on to more complex Scala programs. This will give your eyes and brain an idea of what Scala code looks like. Next, we're going to take a long and boring tour of Scala's syntax. Finally, we're going to see some options for running (and compiling) Scala programs.

Scala at the Command Line and Scala Scripts

Scala offers different ways to run programs:

  • You can run them interactively at a REPL (read-eval-print loop) command line.

  • You can run single-file Scala scripts.

  • You can compile your Scala programs into class files that can be combined ...

Get Beginning Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.