Category: Scala Tutorial

Scala – Recursive Functions 0

Scala – Recursive Functions

In Scala, Recursion is an important concept in pure functional programming language.By definition, Recursive function is a function which calls itself. We need to to be careful while using recursive functions, because program may...

Scala Higher Order Function 0

Scala Higher Order Function

In scala, when a function accepts another function as an argument or returns a function as an output, is called Higher order function. Let’s understand this with examples. Example1 Map is the good example...

Scala Currying Function 0

Scala Currying Function

In this tutorial, we will learn about currying functions in scala.Suppose, we have a function that has multiple arguments and this function can be transformed into series of functions where each function has single...

Scala partially applied function 0

Scala partially applied function

A partially applied function, as its name says, is a function where arguments of functions can be applied partially, and as a result it provides another function that still “expects” to get its missing...

Scala Anonymous Function 0

Scala Anonymous Function

In scala, when a function is written without a name is know as anonymous function, also called function literal – so you can pass it into a method that takes a function as an...

Scala Functions 0

Scala Functions

When program gets larger, it needs to be divided into smaller reusable, more manageable pieces. It can be achieved by writing functions where code can be divided. Scala provides rich set of built in...

Scala Final 0

Scala Final

In Scala, Final is a keyword that is used to prevent inheritance of super class in any of the child classes.We can declare variables, methods and classes with Final keyword. Let’s understand them with...

Scala Field Overriding 0

Scala Field Overriding

In Scala, we can override the fields but with some rules. Let’s understand it with some examples. If you look at the below code, where we are overriding the field named ‘age’ from 30...

Scala – This Keyword 0

Scala – This Keyword

In Scala, this keyword is used to refer as current object of the class. By using dot(.) after it, we can call instance variable, methods and constructors. As we have seen in earlier post,...

Scala – Inheritance 0

Scala – Inheritance

In the previous post, we have learnt about method overloading. Now, we will see what is Inheritance in scala. Inheritance is used for reusability of the code. When a class wants to use/reimplement code...