July 2018
Intermediate
186 pages
3h 24m
English
Now that we can use REPL, let's understand the base Scala syntax. For now, it's not necessary to learn it in detail, but let's get familiar with it by using an example.
For a formal, detailed description, refer to the SLS: Scala Language Specification here: http://scala-lang.org/files/archive/spec/2.12/.
Scala compilation unit – This is a set of definitions inside an entity (template-entity), which can be an object, a class, or a trait. We will speak about the Object-Oriented part of the Scala language in detail later. Now, let's look at the basic syntax. Let's define some classes in REPL:
> class X { def f():Int = 1 }
> Class X defined // answer in REPLDefinitions inside the entity can be nested entities, ...
Read now
Unlock full access