WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Scala Tutorial


Scala Tutorial. Scala is a modern multi-paradigm programming language. Scala has been created by Martin Odersky and he released the first version in 2003. It is a integrated features of object-oriented and functional , statically type languages..

Scala runs on a Java virtual machine and is compatible with existing Java programs.

Scala source code is compiled into Java bytecode, so it can run on top of the JVM and can call existing Java class libraries.


Who is suitable for reading this tutorial?

This tutorial is for developers who want to learn the Scala programming language from scratch. Of course, this tutorial will also delve into some modules to give you a better understanding of Scala applications.



You need to know before you can learn this tutorial

Before continuing this tutorial, you should understand some basic computer programming terminology. If you have studied the Java programming language, it will help you get to know Scala programming faster.

Learn Java Tutorial.


The first Scala program: Hello World

The following is a typical Hello World program written in Scala:

example(HelloWorld.scala)

object HelloWorld {
    def main(args: Array[String]): Unit = {
        println("Hello, world!")
    }
}

Save the above code as a HelloWorld.scala file and execute the above scala program (you can also execute it directly online):

$ scalac HelloWorld.< /span>scala // Compile source code into bytecode
$ scala HelloWorld // Put the bytecode into the virtual machine to explain Run

The output is:

Hello, world!