Artificial Intelligence (AI) & Machine Learning Course for Managers

 Enroll Now


54 / 53

Scala - Quick Facts

  • Scala is a modern multi-paradigm programming language designed to express common programming patterns in a concise, elegant, and type-safe way.

    • Scala supports object-oriented as well as functional methods of programming.

    • Scala is based on Java and lets you write programs in fewer lines than many other programming languages.

    • Scala can be run in a CLI (command line interpreter) interactive mode as well as a script (a program).

What it is:

Scala is object-oriented
Everything in Scala is an object including functions.

Scala is functional
Scala supports anonymous functions, higher-order functions, it allows functions to be nested and supports currying.

Scala is statically typed
Scala doesn't need to specify a type in most cases.

Scala runs on the JVM
The Scala compiler compiles your Scala code into Java Byte Code, which can then be executed by the 'scala' command on Java Virtual Machine (JVM), similar to 'java' command.

Scala can Execute Java Code
Scala enables you to use all the classes of the Java SDK and also your own custom Java classes, or your favorite Java open source projects.

Scala can do Concurrent & Synchronize processing
Scala allows you to write codes in a type-safe and immutable manner, which makes it easy to apply concurrency and parallelism (Synchronize).

Scala vs Java
Scala has a set of features that completely differ from Java. Some of these are -

All types are objects
Type inference
Nested Functions
Functions are objects
Domain specific language (DSL) support
Concurrency support inspired by Erlang
Most importantly, unlike java, ';' line end character is optional

In this learning, we will code Scala on Notebook which provides GUI for inputs and outputs of Scala.