Open In App

What makes Scala scalable?

Scalability of a language is effected by some factors ranging from syntax details to component abstraction construct. The main aspect of scala that makes it scalable is that it is a combination of both object-oriented and functional programming. It has good support for both the programming constructs like high-order functions, tail-call optimization, immutable values, pattern matching, polymorphism, abstraction, inheritance etc. Scala also includes its own interpreter which can be used to execute instruction directly, without previous compiling. Another key feature is parallel collections library designed to help developers address parallel programming patterns. 
Some Another features are as follow : 
 




class Geek
{
    // data members of the class.
    String name;
    int id;
   
    // constructor would initialized data members
    // with the values of passed arguments while
    // object of that class created.
    Geek(String name, int id)
    {
        this.name = name;
        this.id = id;
    }
}




class Geek(name: String, id: Int) {}




// Function to find string which has
   // first character of each word.
   static char first(String str)
   {
       for (int i = 0; i < str.length(); i++)
           if (Character.isUpperCase(str.charAt(i)))
               return str.charAt(i);
       return 0;
   }




val first = str.exists(_.isUpperCase)

 


Article Tags :