Scala Language Basics

Scala Data Types

By: Stephen Patrick | 02 Aug 2016 | Category: Scala Language Basics

Scala Data Types

Scala provides support for different data types. One major difference when compared to Java is that all Scala Data types are objects. In Java when we use primitive types such as int they can be converted to their wrapper object type and vice a versa through a process known as boxing and unboxing.

Read More

Scala Variables

By: Stephen Patrick | 02 Aug 2016 | Category: Scala Language Basics

Scala Variables

Scala allows us to define variables in a number of different ways. Scala allows us to define different kinds of variables namely val and var. A val can be considered similar to a Java final variable in that once it is assigned it cannot be reassigned. A var can be considered as a Java non final variable.

Read More

Scala Arrays

By: Stephen Patrick | 03 Aug 2016 | Category: Scala Language Basics

Scala Arrays

Scala provides support for Array data types. In Scala an Array is an instance of the scala.Array class. An Array in Scala is similar to a Java Array. Let’s look at some examples of creating Arrays in Scala.

Read More

Scala Control Structures

By: Stephen Patrick | 03 Aug 2016 | Category: Scala Language Basics

Scala Control Structures

Scala provides a number of different control structures. Scala provides the if / else control structure that is the same as used in most programming languages. Scala also provides a number of iterative control structures such as for, and while loops.

Read More

Scala Lists

By: Stephen Patrick | 07 Aug 2016 | Category: Scala Language Basics

Scala Lists

Scala provides a List collection type scala.List. Like an Array the list data structure contains a sequence of elements. However, there is an important difference between a Scala Array and a Scala List. The Scala List data type is an immutable data type, while the Scala Array is a mutable data type.

Read More

Scala Tuples

By: Stephen Patrick | 08 Aug 2016 | Category: Scala Language Basics

Scala Tuples

Scala also provides a tuple object that combines a number of elements together. Tuples like lists are immutable, however tuples can contain any type of element. Tuples are useful in different situations such as returning multiple objects from a method.

Read More

Scala Maps

By: Stephen Patrick | 09 Aug 2016 | Category: Scala Language Basics

Scala Maps

As we mentioned previously Scala provides a number of collection classes. The collection classes that Scala provides can be divided into mutable and immutable types. Scala also provides a Map data type. Moreover, Scala provides both mutable and immutable Map types.

Read More

Scala Common Collection Operations

By: Stephen Patrick | 14 Aug 2016 | Category: Scala Language Basics

Scala Common Collection Operations

We will look at some common operations performed on Scala collections. Scala provides the map method can be used to transform a collection. The map method applies a function to every method on a collection, returning a new collection of a similar type.

Read More