Scala Stack operations explained

Welcome to Scala series. In this tutorial, you will learn about the Scala Stack and I have explained most of the Stack operations with examples. A stack is based on the Last-In-First-Out algorithm(LIFO) and it is one of the basic collections being used in any programming language. Scala does support Stack out of the box. Some of the real-world use cases […]

Scala Queue operations explained

Welcome to Scala series. In this tutorial, you will learn about the Scala Queue and I have explained most of the Queue operations with examples. Queue is one of the basic and important data structures of any programming language. Scala does support Queue. Queue is part of the Scala collection package and it is based on IndexedSeq. What is a Scala […]

Scala list operations explained

Welcome to Scala series. In this tutorial, you will learn about the Scala list and I have explained most of the list operations in detail. List() is a collection to store values in an ordered fashion. It allows store duplicate values. List() extends LinearSeq() trait and it is based on Last In First Out model. List() is part of both immutable […]

Scala Curried or currying functions

Welcome to Scala series. In this tutorial, you will learn about Scala Curried or currying functions in detail. Usually a method or a function can have N number of arguments. Example def add(a: Int, b: Int): Int = { a + b } add(1,3) Result : 4 The above function/method has two arguments a and b. Curried or Currying functions In […]

Scala Higher order functions

Welcome to Scala series. In this tutorial, you will learn about Scala Higher order functions in detail. If a function can pass another function or If function returns another function then it is called as Higher order function in Scala. Basically in Scala, a function is treated as first class citizen, which means a function can be treated normally as a […]

Scala Range

Welcome to Scala series. In this tutorial, you will learn about Scala Range in detail. Scala Range is a sequence of integers or characters with a certain order or increment. It is mainly used for looping constructs. E.g Integer Range using “to” Here we are trying to create a range from 1 to 10 inclusive of 10. Integer Range using “to” with […]

Scala String Interpolation in detail

Welcome to Scala series. In this tutorial, you will learn about Scala String Interpolation in detail. Scala String interpolation brings us a different way to create a string. It allows us to create dynamic strings with dynamic values during runtime. Let us see a few examples “s” Interpolation Let us print the age dynamically rather than appending to a string as a […]

Scala case class

Welcome to Scala series. In this tutorial, you will learn about Scala case class. Case class is a special type of class. It will automatically give all boiler plate code such getters and setters by default.It is used mainly as a POJO classes similar to Java. Syntax Case class Object creation( apply() method) Usually , we will use new keyword to create […]