Monday 31 July 2017

Scala Installation & Compilation

 Install Scala on Ubuntu Operating System.

1.open the Terminal.
2.Run
3.sudo apt-get install scala
4.Run the command

Install Scala on Windows 

1)Download scala from website(https://www.scala-lang.org/download/)
2)Click next until finish
3)go to c drive, in that program file, Scala,bin(c:\Program Files(x86)\scala\bin)
4)copy path.
5)Right click on MyComputer,property,Advance System Settings,click on Environment Variables
6)Edit PATH, if no PATH create it and paste scala path,after giving semicolon(;)paste(c:\Program Files(x86)\scala\bin) press ok.
7)go to command prompt, type scalac.

Completion & Execution 

Example Program


object Hello
 {
    def main (args:Array[String])
     {
        pritln("Hello Welcome to scala ")
    }
}


1)Save program as hello.scala
2)open the terminal
3)go to the directory where you save the file(cd desktop)
4)scalar hello.scala
5)scala hello
6)out put :Hello Welcome to Scala