Scala List max() operation with examples

Welcome to Scala series. In this tutorial, you will learn about Scala List max() operation with examples. List() is a collection to store values in an ordered fashion. max() operation is a useful operation of the Scala List which allows us to retrieve maximum element/value from the list. When you call this operation on a Scala list, it returns an element […]

Scala List min() operation with examples

Welcome to Scala series. In this tutorial, you will learn about Scala List min() operation with examples. List() is a collection to store values in an ordered fashion. min() operation is a useful operation of the Scala List which allows us to retrieve minimum element/value from the list. When you call this operation on a Scala list, it returns an element […]

Scala List distinct() operation with examples

Welcome to Scala series. In this tutorial, you will learn about Scala List distinct() operation with examples. List() is a collection to store values in an ordered fashion. distinct() operation is a useful operation Scala List which allows us to retrieve distinct/unique values from the list. When you call this operation on a Scala list, it returns a new collection with […]

Scala List tail() operation with examples

Welcome to Scala series. In this tutorial, you will learn about Scala List tail() operation with examples. List() is a collection to store values in an ordered fashion. tail() operation is a useful operation Scala List which allows us to retrieve the rest of the collection without the first/head element of the list.When you call this  operation on a Scala list, […]

Scala List head() operation with examples

Welcome to Scala series. In this tutorial, you will learn about Scala List head() operation with examples. List() is a collection to store values in an ordered fashion. In order to get first/head element of the list,usually in Java we get the data of zero index.But in Scala, we have an operation head() to get the head/first element of the list. […]

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 […]