Sunday 9 August 2020

Introduction to Scala

 Scala is a general-purpose programming language like Java. Scala was developed to solve the shortcomings of Java Programming language. Distributed computing frameworks like Apache Spark uses Scala widely. 

Scala is syntactically concise, it infers the type, semicolon depends on the context.

 

Scala uses both a compiler and interpreter. For example, you can create Scala scripts that are interpreted. If you compile the Scala code, it is converted into Java byte code. Scala compiler also compiles the code to JavaScript.

 

Is Scala an Object-Oriented Language?

Yes, Scala is a pure object-oriented programming language. Since Scala is a pure object-oriented language, functions are also objects.

 

Scala also supports functional constructs like pattern matching, closures, and Currying.

 

Is Scala supports Operator overloading?

Yes, Scala supports operator loading. Scala treats operators as methods of an object.

 

Is Scala statically typed?

Yes, Scala is a statically typed language. Variable type must be known at compile time. That means once a variable is declared with type ‘T’, you can’t change the type of variable in its lifetime.

 

Scala runs on JVM

Since Scala runs on Java Virtual Machine, you can use all the existing Java libraries in Scala.

 

Scala does not have primitive types

There are no primitive types in Scala. Everything is an object.


Previous                                                    Next                                                    Home

No comments:

Post a Comment