July 2017
Intermediate to advanced
796 pages
18h 55m
English
As a first example, we will use the pretty common Hello, world! program in order to show you how to use Scala and its tools without knowing much about it. Let's open your favorite editor (this example runs on Windows 7, but can be run similarly on Ubuntu or macOS), say Notepad++, and type the following lines of code:
object HelloWorld { def main(args: Array[String]){ println("Hello, world!") } }
Now, save the code with a name, say HelloWorld.scala, as shown in the following figure:

Let's compile the source file as follows:
C:\>scalac HelloWorld.scala
Read now
Unlock full access