How to use Scala TreeMap Collection

Welcome to Scala series. In this tutorial, you will learn How to use Scala TreeMap collection with detail examples of each operation. So before learning about Scala TreeMap, we will first understand the basics of a Map. Scala Map Map is a collection of key and value pairs. It stores two values: one key and a value. Scala provides two variants […]

How to use Scala HashMap Collection

Welcome to Scala series. In this tutorial, you will learn How to use Scala HashMap collection with detail examples of each operation. So before learning about Scala HashMap, we will first understand the basics of a Map. Scala Map Map is a collection of key and value pairs. It stores two values: one key and a value. Scala provides two variants […]

How to use Scala ListMap Collection

Welcome to Scala series. In this tutorial, you will learn How to use Scala ListMap collection with detail examples of each operation. So before learning about Scala ListMap, we will first understand the basics of a map and a list. Scala Map Map is a collection of key and value pairs. It stores two values: one key and a value. Scala […]

How to use Scala Map collection

Welcome to Scala series. In this tutorial, you will learn How to use Scala Map collection with detail examples of each operation. Scala Map Map is a collection of key and value pairs. It stores two values: one key and a value. Scala provides two variants of Map: Mutable map Immutable map(default) Key should always be unique and it cannot have […]

How to use Scala TreeSet collection

Welcome to Scala series. In this tutorial, you will learn How to use Scala TreeSet collection with detail examples of each operation. So Before learning Scala TreeSet, let us understand a few basics of Scala Set collection. Scala Set Set is a collection to store values that don’t have/allow duplicate values. Always Set will have unique elements. Set is Iterable and […]

How to drop elements in Scala Set collection

Welcome to Scala series. In this tutorial, you will learn How to drop elements in Scala Set collection. Basics of Scala Set Set is a collection to store values that don’t have/allow duplicate values. Always Set will have unique elements. Set is Iterable and inherits all functionality of the iterable interface. There are two variants of Set in Scala Immutable Set(default) […]

How to use addString() in Scala Set collection

Welcome to Scala series. In this tutorial, you will learn How to use addString() in Scala Set collection. Basics of Scala Set Set is a collection to store values that don’t have/allow duplicate values. Always Set will have unique elements. Set is Iterable and inherits all functionality of the iterable interface. There are two variants of Set in Scala Immutable Set(default) […]

How to count number of elements in Scala Set

Welcome to Scala series. In this tutorial, you will learn How to count number of elements in Scala Set. Basics of Scala Set Set is a collection to store values that don’t have/allow duplicate values. Always Set will have unique elements. Set is Iterable and inherits all functionality of the iterable interface. There are two variants of Set in Scala Immutable […]

How to sum elements of Scala Set collection

Welcome to Scala series. In this tutorial, you will learn How to sum elements of Scala Set collection Basics of Scala Set Set is a collection to store values that don’t have/allow duplicate values. Always Set will have unique elements. Set is Iterable and inherits all functionality of the iterable interface. There are two variants of Set in Scala Immutable Set(default) […]

How to use Scala SortedSet collection

Welcome to Scala series. In this tutorial, you will learn How to use Scala SortedSet collection with detail examples of each operation. So Before learning Scala SortedSet, let us understand a few basics of Scala Set collection. Scala Set Set is a collection to store values that don’t have/allow duplicate values. Always Set will have unique elements. Set is Iterable and […]

How to use Scala HashSet collection

Welcome to Scala series. In this tutorial, you will learn How to use Scala HashSet collection with detail examples of each operation. So Before learning Scala HashSet, let us understand a few basics of  Scala Set collection. Scala Set Set is a collection to store values that don’t have/allow duplicate values. Always Set will have unique elements. Set is Iterable and […]

How to use Scala ListSet collection

Welcome to Scala series. In this tutorial, you will learn How to use Scala ListSet collection with detail examples of each operation. So Before learning Scala ListSet, let us understand a few basics of Scala List and Set collection Scala List List() is a collection to store values in an ordered fashion. It allows store duplicate values. List() extends LinearSeq() trait […]

Scala I/O – How to read a file

Hey guys! Welcome to Scala series. In this tutorial, you will learn How to read a file using Scala I/O api. In many cases, we might need to read the contents of the file in our program and work on the file to manipulate the data and  play with it. So Yes, Scala has provided a Scala I/O api to read […]