In this tutorial, you will learn, how to install Scala programming language in Windows

To install Scala, you must install Java first. To check whether Java installed in your or not, go to command prompt and type

java -version

If the above command gives java version, you are ready to install Scala. Or else you must install Java. If you don't know to install Java on Windows, use the below link

After installing Java, Download the latest Scala version using

It gives an msi file. The installation is as usual windows standard installation(click next-next ).

That's all. You successfully installed the Scala programming on your Windows machine. To check the Scala installation, go to command prompt and type

scala -version

Unlike Java, you can directly connect to Scala editor by simply typing scala in your command prompt

The println() statement is used to print the output in the console. In Java, you have System.out.println()

Or else you can save your Scala program in notepad with .scala as the extension.

object Hello

 def main(args: Array[String]): Unit = {

    println("hello world!")



Save the above code as Hello.scala. And compile the code in command prompt using

scalac d:/scala/Hello.scala

After the successful compilation, you can run the above program using

scalac d:/scala/Hello

Now you learned the hello world program. A first step program for every language. Note a difference from command prompt scala editor and notepad file. In command prompt scala editor, you can directly call the println() without any method. However, this is not the case with notepad file. You must create an object (class in Java ) and define the main method.

Here object and def are reserved keyword.

So if you want to run a program, you must create an object and define the main method. And write the code inside the main method. Here def main acts as the main method. The main method is the starting point of execution.