Scala – Files I/O
In this guide, we will discuss Scala Files I/O . Scala is open to make use of any Java objects and java.io.File is one of the objects which can be used in…
In this guide, we will discuss Scala Files I/O . Scala is open to make use of any Java objects and java.io.File is one of the objects which can be used in…
An extractor in Scala is an object that has a method called unapply as one of its members. The purpose of that unapply method is to match a value and take it…
In this guide, we will discuss Scala Exception Handling. Scala's exceptions work like exceptions in many other languages like Java. Instead of returning a value in the normal way, a…
This chapter explains how Scala supports regular expressions through Regex class available in the scala.util.matching package. Try the following example program where we will try to find out word Scala from a statement. Example…
Scala Pattern matching is the second most widely used feature of Scala, after function values and closures. Scala provides great support for pattern matching, in processing the messages. A pattern…
In this guide, we will discuss Scala Traits. A trait encapsulates method and field definitions, which can then be reused by mixing them into classes. Unlike class inheritance, in which…
In this guide, we will discuss Scala Iterators. An iterator is not a collection, but rather a way to access the elements of a collection one by one. The two…
Scala Options [ T ] is a container for zero or one element of a given type. An Option[T] can be either Some[T] or None object, which represents a missing value. For instance, the…
Scala tuple combines a fixed number of items together so that they can be passed around as a whole. Unlike an array or list, a tuple can hold objects with…
Scala maps is a collection of key/value pairs. Any value can be retrieved based on its key. Keys are unique in the Map, but values need not be unique. Maps…