Posts

Showing posts from September, 2023

Features of Scala

 Below are following features of Scala, Type inference Singleton object Immutability Lazy computation Case classes and Pattern matching Concurrency control String interpolation Higher order function Traits Rich collection set Type Inference In Scala, you don't require to mention data type and function return type explicitly. Scala is enough smart to deduce the type of data.  The return type of function is determined by the type of last expression/value/data present in the function. Singleton object In Scala, there are no static variables or methods. Scala uses singleton object, which is essentially class with only one object in the source file.  Singleton object is declared by using object instead of class keyword. Immutability Scala uses immutability concept. Each declared variable is immutable by default. Immutable means you can't modify its value. You can also create mutable variables which can be changed. Immutable data helps to manage concurrency control which requires man

Scala Overview & History & Popularity & Usage

Image
 Scala Overview Scala is an object-oriented and functional programming language. Scala is a general-purpose programming language.  It supports object oriented, functional and imperative programming approaches.  It is a pure object-oriented language in the sense that every value is an object and functional language in the sense that every function is a value. In Scala, everything is an object whether it is a function or a number.  It is a strong static type language.  It does not have concept of primitive data. The name of Scala is derived from word scalable which means it can grow with the demand of users. Scala is not an extension of Java, but it is completely interoperable with it. While compilation, Scala file translates to Java bytecode and runs on JVM (Java Virtual machine). History Scala was created and developed by Martin Odersky. Martin started working on Scala in 2001 at the Ecole Polytechnique Federale de Lausanne (EPFL). It was officially released on January 20, 2004. It was