Chapter 3

Scala Basics

Now that we have explored the tools that we will be using, it is time to put them to use and begin our journey learning how to program with the Scala language. We will spend most of this chapter working in the REPL environment and learning some of the basics of Scala and programming in general. Toward the end we will write our first little script to solve a problem and run that as well to see how basic programs function.

3.1 Expressions, Types, and Basic Math

All programming languages are built from certain fundamental parts. In English you put together words into phrases and then combine phrases into sentences. These sentences can be put together to make paragraphs. To help you understand programming, we will make analogies ...

Get Introduction to the Art of Programming Using 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.