Scala – A Scalable Language
Scala stands for “scalable language.” It is certainly not referring to scalability from the application performance perspective. It is a mix of object-oriented and functional programming concepts.
Scala code gets compiled to class file and runs on standard Java Virtual Machine.
Below are few key points about Scala:
It’s a pure object-oriented programming (OOP) language. Unlike Java, in Scala every variable is an object, and every “operator” is a method.
It is also a functional programming (FP) language, so you can pass functions around as variables.
Scala code runs on the JVM and works seamlessly with Java libraries.
Scala is statically typed.
Scala is pure object-oriented
Object-oriented programming has been conventional for a long time. But many languages take values that are not objects, e.g. primitive values in Java. Conversly, Scala is pure object-oriented language, i.e. every value is an object and every operation is a method call.
E.g. When we do 2 * 4 in Scala, we are actually calling a method named “*” defined in class Int.
Scala is functional
Scala is also a Functional programming (FP) language. Functional programming is not new in programming world. Lisp was one of the first functional programming languages used long time ago. In functional programming functions are same as any other type like int or long. You can pass functions as method arguments, return them as a value or store them in a variable.