Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 1. The Basics

Chapter 1. The Basics

Topics in This Chapter A1

  • 1.1 The Scala Interpreter — page 1

  • 1.2 Declaring Values and Variables — page 3

  • 1.3 Commonly Used Types — page 4

  • 1.4 Arithmetic and Operator Overloading — page 5

  • 1.5 Calling Functions and Methods — page 7

  • 1.6 The apply Method — page 8

  • 1.7 Scaladoc — page 8

  • Exercises — page 11

In this chapter, you will learn how to use Scala as an industrial-strength pocket calculator, working interactively with numbers and arithmetic operations. We introduce a number of important Scala concepts and idioms along the way. You will also learn how to browse the Scaladoc documentation at a beginner’s level.

Highlights of this introduction are:

  • Using the Scala interpreter

  • Defining variables with var and val

  • Numeric types

  • Using operators and functions

  • Navigating Scaladoc

  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint