Home »
Scala
Overview of Scala
By IncludeHelp Last updated : October 07, 2024
What is Scala?
Scala is a programming language developed by Martin Odersky. It came into the market in 2003. Scala Stands for Scalable Language. Scala is a JAVA based programming Language which is much easier to code than Java. So is treated as future replacement of Java in enterprise software development.
Features of scala programming language
Some features of Scala are:
- It runs on JVM but compiler is different.
- Integrates Features of both Object-Oriented Programming and Functional Programming.
- Lazy Computation, it increases performance, the expression evaluates only when its evaluation is required.
- Immutability: it means the value of a data cannot be changed by default.
- Case Classes and Pattern Matching.
- Type Interface: It recognizes data type and functions return type itself.
- Concurrency Control: Scala Provide concurrency control using actor model.
- High Order Function: A function that works on another function.
Coding in Scala is easier than Java and it saves a lot of coding because of the above feature and gives a more efficient program.
Scala is a general-purpose language can be used anywhere. It runs on JVM that means its byte code can replace java. So, Java Application can be made using Scala also.
How to install Scala?
Scala installation is very easy. It can be installed on both Windows and Linux based systems. As it sits on top of Java, it requires Java to be installed on your system before installation.
Requirement: JAVA 1.8 Or Above
Steps to install Scala
Step 1: Check for Java on your System, Run the following command in your Command Prompt or Terminal
For Windows , \>java –version
For Linux, $java –version
If you have Java installed on your system the version of Java Will prompt otherwise you need to install java on your system.
Just Go To oracle, Menu -> Product -> Java.
Step 2: Set your java environment variable JAVA_HOME to your java install location.
For this use the following Command,
For Windows, Set JAVA_HOME to C:\ProgramFiles\java\jdk1.7.0_60
For Linus, Export JAVA_HOME=/usr/local/java-current
Step 3: Install Scala, download Scala from https://www.scala-lang.org/download/
A jar file will download. After it's Downloaded Run the command to install this Jar File on your system,
For Windows, \>java –jar scala-2.11.5-installer.jar\>
For Linux, $java –jar scala-2.9.0.1-installer.jar
Check for Scala installation on your system using following commands,
For Windows , \>scala –version
For Linux, $scala –version